Lines Matching refs:go
38 static inline void adlink_mpg24_i2c_lock(struct go7007 *go) in adlink_mpg24_i2c_lock() argument
42 go7007_write_addr(go, 0x3c82, 0x0020); in adlink_mpg24_i2c_lock()
45 static inline void adlink_mpg24_i2c_unlock(struct go7007 *go) in adlink_mpg24_i2c_unlock() argument
48 go7007_write_addr(go, 0x3c82, 0x0000); in adlink_mpg24_i2c_unlock()
52 static int go7007_i2c_xfer(struct go7007 *go, u16 addr, int read, in go7007_i2c_xfer() argument
58 if (go->status == STATUS_SHUTDOWN) in go7007_i2c_xfer()
63 dev_dbg(go->dev, "go7007-i2c: reading 0x%02x on 0x%02x\n", in go7007_i2c_xfer()
66 dev_dbg(go->dev, in go7007_i2c_xfer()
71 mutex_lock(&go->hw_lock); in go7007_i2c_xfer()
73 if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) in go7007_i2c_xfer()
74 adlink_mpg24_i2c_lock(go); in go7007_i2c_xfer()
78 if (go7007_read_addr(go, STATUS_REG_ADDR, &val) < 0) in go7007_i2c_xfer()
85 dev_err(go->dev, "go7007-i2c: I2C adapter is hung\n"); in go7007_i2c_xfer()
90 go7007_write_addr(go, I2C_CTRL_REG_ADDR, flags); in go7007_i2c_xfer()
91 go7007_write_addr(go, I2C_LO_ADDR_REG_ADDR, command); in go7007_i2c_xfer()
95 go7007_write_addr(go, I2C_DATA_REG_ADDR, *data); in go7007_i2c_xfer()
96 go7007_write_addr(go, I2C_DEV_UP_ADDR_REG_ADDR, in go7007_i2c_xfer()
103 if (go7007_read_addr(go, I2C_DATA_REG_ADDR, &val) < 0) in go7007_i2c_xfer()
107 go7007_write_addr(go, I2C_DEV_UP_ADDR_REG_ADDR, in go7007_i2c_xfer()
112 if (go7007_read_addr(go, STATUS_REG_ADDR, &val) < 0) in go7007_i2c_xfer()
119 dev_err(go->dev, "go7007-i2c: I2C adapter is hung\n"); in go7007_i2c_xfer()
124 if (go7007_read_addr(go, I2C_DATA_REG_ADDR, &val) < 0) in go7007_i2c_xfer()
130 if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) in go7007_i2c_xfer()
131 adlink_mpg24_i2c_unlock(go); in go7007_i2c_xfer()
132 mutex_unlock(&go->hw_lock); in go7007_i2c_xfer()
140 struct go7007 *go = i2c_get_adapdata(adapter); in go7007_smbus_xfer() local
144 return go7007_i2c_xfer(go, addr, read_write == I2C_SMBUS_READ, command, in go7007_smbus_xfer()
156 struct go7007 *go = i2c_get_adapdata(adapter); in go7007_i2c_master_xfer() local
168 if (go7007_i2c_xfer(go, msgs[i].addr, 1, in go7007_i2c_master_xfer()
176 if (go7007_i2c_xfer(go, msgs[i].addr, 0, in go7007_i2c_master_xfer()
204 int go7007_i2c_init(struct go7007 *go) in go7007_i2c_init() argument
206 memcpy(&go->i2c_adapter, &go7007_adap_templ, in go7007_i2c_init()
208 go->i2c_adapter.dev.parent = go->dev; in go7007_i2c_init()
209 i2c_set_adapdata(&go->i2c_adapter, go); in go7007_i2c_init()
210 if (i2c_add_adapter(&go->i2c_adapter) < 0) { in go7007_i2c_init()
211 dev_err(go->dev, in go7007_i2c_init()