Lines Matching +full:bit +full:- +full:banging

1 // SPDX-License-Identifier: GPL-2.0
49 if ((cbuf->num_cmds % 2) == 0) in cmdbuf_add()
50 cbuf->tmp = cmd; in cmdbuf_add()
52 cbuf->tmp |= cmd << 4; in cmdbuf_add()
53 buf_idx = cbuf->num_cmds / 2; in cmdbuf_add()
54 if (buf_idx < ARRAY_SIZE(cbuf->data)) in cmdbuf_add()
55 cbuf->data[buf_idx] = cbuf->tmp; in cmdbuf_add()
57 cbuf->num_cmds++; in cmdbuf_add()
63 if (cbuf->num_cmds % 2) in put_end()
91 cmdbuf_add(cbuf, (i == size - 1) ? I_DATA_H_NOP : I_DATA_L_NOP); in put_byte_read()
103 /* translates msgs to internal commands for bit-banging */
109 cbuf->num_cmds = 0; in translate()
132 v = ioread32(pt3->regs[0] + REG_I2C_R); in wait_i2c_result()
138 return -EIO; in wait_i2c_result()
144 /* send [pre-]translated i2c msgs stored at addr */
151 dev_warn(&pt3->pdev->dev, "(%s) prev. transaction stalled\n", in send_i2c_cmd()
153 return -EIO; in send_i2c_cmd()
156 iowrite32(PT3_I2C_RUN | addr, pt3->regs[0] + REG_I2C_W); in send_i2c_cmd()
160 dev_warn(&pt3->pdev->dev, "(%s) failed.\n", __func__); in send_i2c_cmd()
161 return -EIO; in send_i2c_cmd()
172 ioread32(pt3->regs[0] + REG_I2C_R); in pt3_init_all_demods()
176 /* init commands for two ISDB-T tuners are hidden in ROM. */
185 iowrite32(PT3_I2C_RESET, pt3->regs[0] + REG_I2C_W); in pt3_i2c_reset()
200 cbuf = pt3->i2c_buf; in pt3_i2c_master_xfer()
204 dev_warn(&pt3->pdev->dev, in pt3_i2c_master_xfer()
207 return -EINVAL; in pt3_i2c_master_xfer()
211 memcpy_toio(pt3->regs[1] + PT3_I2C_BASE + PT3_CMD_ADDR_NORMAL / 2, in pt3_i2c_master_xfer()
212 cbuf->data, cbuf->num_cmds); in pt3_i2c_master_xfer()
215 return -EIO; in pt3_i2c_master_xfer()
217 p = pt3->regs[1] + PT3_I2C_BASE; in pt3_i2c_master_xfer()