Lines Matching refs:pt3
126 static int wait_i2c_result(struct pt3_board *pt3, u32 *result, int max_wait) in wait_i2c_result() argument
132 v = ioread32(pt3->regs[0] + REG_I2C_R); in wait_i2c_result()
145 static int send_i2c_cmd(struct pt3_board *pt3, u32 addr) in send_i2c_cmd() argument
150 if (wait_i2c_result(pt3, NULL, 50)) { in send_i2c_cmd()
151 dev_warn(&pt3->pdev->dev, "(%s) prev. transaction stalled\n", in send_i2c_cmd()
156 iowrite32(PT3_I2C_RUN | addr, pt3->regs[0] + REG_I2C_W); in send_i2c_cmd()
159 if (wait_i2c_result(pt3, &ret, 500) || (ret & STAT_SEQ_ERROR)) { in send_i2c_cmd()
160 dev_warn(&pt3->pdev->dev, "(%s) failed.\n", __func__); in send_i2c_cmd()
170 int pt3_init_all_demods(struct pt3_board *pt3) in pt3_init_all_demods() argument
172 ioread32(pt3->regs[0] + REG_I2C_R); in pt3_init_all_demods()
173 return send_i2c_cmd(pt3, PT3_CMD_ADDR_INIT_DEMOD); in pt3_init_all_demods()
177 int pt3_init_all_mxl301rf(struct pt3_board *pt3) in pt3_init_all_mxl301rf() argument
180 return send_i2c_cmd(pt3, PT3_CMD_ADDR_INIT_TUNER); in pt3_init_all_mxl301rf()
183 void pt3_i2c_reset(struct pt3_board *pt3) in pt3_i2c_reset() argument
185 iowrite32(PT3_I2C_RESET, pt3->regs[0] + REG_I2C_W); in pt3_i2c_reset()
194 struct pt3_board *pt3; in pt3_i2c_master_xfer() local
199 pt3 = i2c_get_adapdata(adap); in pt3_i2c_master_xfer()
200 cbuf = pt3->i2c_buf; in pt3_i2c_master_xfer()
204 dev_warn(&pt3->pdev->dev, in pt3_i2c_master_xfer()
211 memcpy_toio(pt3->regs[1] + PT3_I2C_BASE + PT3_CMD_ADDR_NORMAL / 2, in pt3_i2c_master_xfer()
214 if (send_i2c_cmd(pt3, PT3_CMD_ADDR_NORMAL) < 0) in pt3_i2c_master_xfer()
217 p = pt3->regs[1] + PT3_I2C_BASE; in pt3_i2c_master_xfer()