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