Home
last modified time | relevance | path

Searched refs:i2c_dev (Results 1 – 17 of 17) sorted by relevance

/drivers/i2c/busses/
Di2c-tegra.c178 static void dvc_writel(struct tegra_i2c_dev *i2c_dev, u32 val, unsigned long reg) in dvc_writel() argument
180 writel(val, i2c_dev->base + reg); in dvc_writel()
183 static u32 dvc_readl(struct tegra_i2c_dev *i2c_dev, unsigned long reg) in dvc_readl() argument
185 return readl(i2c_dev->base + reg); in dvc_readl()
192 static unsigned long tegra_i2c_reg_addr(struct tegra_i2c_dev *i2c_dev, in tegra_i2c_reg_addr() argument
195 if (i2c_dev->is_dvc) in tegra_i2c_reg_addr()
200 static void i2c_writel(struct tegra_i2c_dev *i2c_dev, u32 val, in i2c_writel() argument
203 writel(val, i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg)); in i2c_writel()
207 readl(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg)); in i2c_writel()
210 static u32 i2c_readl(struct tegra_i2c_dev *i2c_dev, unsigned long reg) in i2c_readl() argument
[all …]
Di2c-st.c237 static void st_i2c_flush_rx_fifo(struct st_i2c_dev *i2c_dev) in st_i2c_flush_rx_fifo() argument
246 if (readl_relaxed(i2c_dev->base + SSC_STA) & SSC_STA_RIR) in st_i2c_flush_rx_fifo()
249 count = readl_relaxed(i2c_dev->base + SSC_RX_FSTAT) & in st_i2c_flush_rx_fifo()
253 readl_relaxed(i2c_dev->base + SSC_RBUF); in st_i2c_flush_rx_fifo()
256 static void st_i2c_soft_reset(struct st_i2c_dev *i2c_dev) in st_i2c_soft_reset() argument
262 st_i2c_flush_rx_fifo(i2c_dev); in st_i2c_soft_reset()
264 st_i2c_set_bits(i2c_dev->base + SSC_CTL, SSC_CTL_SR); in st_i2c_soft_reset()
265 st_i2c_clr_bits(i2c_dev->base + SSC_CTL, SSC_CTL_SR); in st_i2c_soft_reset()
272 static void st_i2c_hw_config(struct st_i2c_dev *i2c_dev) in st_i2c_hw_config() argument
276 struct st_i2c_timings *t = &i2c_timings[i2c_dev->mode]; in st_i2c_hw_config()
[all …]
Di2c-bcm2835.c67 static inline void bcm2835_i2c_writel(struct bcm2835_i2c_dev *i2c_dev, in bcm2835_i2c_writel() argument
70 writel(val, i2c_dev->regs + reg); in bcm2835_i2c_writel()
73 static inline u32 bcm2835_i2c_readl(struct bcm2835_i2c_dev *i2c_dev, u32 reg) in bcm2835_i2c_readl() argument
75 return readl(i2c_dev->regs + reg); in bcm2835_i2c_readl()
78 static void bcm2835_fill_txfifo(struct bcm2835_i2c_dev *i2c_dev) in bcm2835_fill_txfifo() argument
82 while (i2c_dev->msg_buf_remaining) { in bcm2835_fill_txfifo()
83 val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); in bcm2835_fill_txfifo()
86 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_FIFO, in bcm2835_fill_txfifo()
87 *i2c_dev->msg_buf); in bcm2835_fill_txfifo()
88 i2c_dev->msg_buf++; in bcm2835_fill_txfifo()
[all …]
Di2c-wmt.c97 static int wmt_i2c_wait_bus_not_busy(struct wmt_i2c_dev *i2c_dev) in wmt_i2c_wait_bus_not_busy() argument
102 while (!(readw(i2c_dev->base + REG_CSR) & CSR_READY_MASK)) { in wmt_i2c_wait_bus_not_busy()
104 dev_warn(i2c_dev->dev, "timeout waiting for bus ready\n"); in wmt_i2c_wait_bus_not_busy()
113 static int wmt_check_status(struct wmt_i2c_dev *i2c_dev) in wmt_check_status() argument
117 if (i2c_dev->cmd_status & ISR_NACK_ADDR) in wmt_check_status()
120 if (i2c_dev->cmd_status & ISR_SCL_TIMEOUT) in wmt_check_status()
129 struct wmt_i2c_dev *i2c_dev = i2c_get_adapdata(adap); in wmt_i2c_write() local
135 ret = wmt_i2c_wait_bus_not_busy(i2c_dev); in wmt_i2c_write()
146 writew(0, i2c_dev->base + REG_CDR); in wmt_i2c_write()
148 writew(pmsg->buf[0] & 0xFF, i2c_dev->base + REG_CDR); in wmt_i2c_write()
[all …]
Di2c-davinci.c121 static inline void davinci_i2c_write_reg(struct davinci_i2c_dev *i2c_dev, in davinci_i2c_write_reg() argument
124 writew_relaxed(val, i2c_dev->base + reg); in davinci_i2c_write_reg()
127 static inline u16 davinci_i2c_read_reg(struct davinci_i2c_dev *i2c_dev, int reg) in davinci_i2c_read_reg() argument
129 return readw_relaxed(i2c_dev->base + reg); in davinci_i2c_read_reg()
169 static inline void davinci_i2c_reset_ctrl(struct davinci_i2c_dev *i2c_dev, in davinci_i2c_reset_ctrl() argument
174 w = davinci_i2c_read_reg(i2c_dev, DAVINCI_I2C_MDR_REG); in davinci_i2c_reset_ctrl()
180 davinci_i2c_write_reg(i2c_dev, DAVINCI_I2C_MDR_REG, w); in davinci_i2c_reset_ctrl()
751 struct davinci_i2c_dev *i2c_dev = platform_get_drvdata(pdev); in davinci_i2c_suspend() local
754 davinci_i2c_reset_ctrl(i2c_dev, 0); in davinci_i2c_suspend()
755 clk_disable_unprepare(i2c_dev->clk); in davinci_i2c_suspend()
[all …]
Di2c-omap.c262 static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev, in omap_i2c_write_reg() argument
265 writew_relaxed(val, i2c_dev->base + in omap_i2c_write_reg()
266 (i2c_dev->regs[reg] << i2c_dev->reg_shift)); in omap_i2c_write_reg()
269 static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg) in omap_i2c_read_reg() argument
271 return readw_relaxed(i2c_dev->base + in omap_i2c_read_reg()
272 (i2c_dev->regs[reg] << i2c_dev->reg_shift)); in omap_i2c_read_reg()
/drivers/gpu/drm/gma500/
Doaktrail_hdmi_i2c.c96 struct hdmi_i2c_dev *i2c_dev = hdmi_dev->i2c_dev; in xfer_read() local
99 i2c_dev->status = I2C_STAT_INIT; in xfer_read()
100 i2c_dev->msg = pmsg; in xfer_read()
101 i2c_dev->buf_offset = 0; in xfer_read()
102 reinit_completion(&i2c_dev->complete); in xfer_read()
109 while (i2c_dev->status != I2C_TRANSACTION_DONE) in xfer_read()
110 wait_for_completion_interruptible_timeout(&i2c_dev->complete, in xfer_read()
129 struct hdmi_i2c_dev *i2c_dev = hdmi_dev->i2c_dev; in oaktrail_hdmi_i2c_access() local
132 mutex_lock(&i2c_dev->i2c_lock); in oaktrail_hdmi_i2c_access()
152 mutex_unlock(&i2c_dev->i2c_lock); in oaktrail_hdmi_i2c_access()
[all …]
Doaktrail.h227 struct hdmi_i2c_dev *i2c_dev; member
/drivers/i2c/
Di2c-dev.c46 struct i2c_dev { struct
56 static struct i2c_dev *i2c_dev_get_by_minor(unsigned index) in i2c_dev_get_by_minor() argument
58 struct i2c_dev *i2c_dev; in i2c_dev_get_by_minor() local
61 list_for_each_entry(i2c_dev, &i2c_dev_list, list) { in i2c_dev_get_by_minor()
62 if (i2c_dev->adap->nr == index) in i2c_dev_get_by_minor()
65 i2c_dev = NULL; in i2c_dev_get_by_minor()
68 return i2c_dev; in i2c_dev_get_by_minor()
71 static struct i2c_dev *get_free_i2c_dev(struct i2c_adapter *adap) in get_free_i2c_dev()
73 struct i2c_dev *i2c_dev; in get_free_i2c_dev() local
81 i2c_dev = kzalloc(sizeof(*i2c_dev), GFP_KERNEL); in get_free_i2c_dev()
[all …]
/drivers/platform/chrome/
Dchromeos_laptop.c348 struct i2c_peripheral *i2c_dev; in chromeos_laptop_probe() local
350 i2c_dev = &cros_laptop->i2c_peripherals[i]; in chromeos_laptop_probe()
353 if (i2c_dev->add == NULL) in chromeos_laptop_probe()
356 if (i2c_dev->state == TIMEDOUT || i2c_dev->state == PROBED) in chromeos_laptop_probe()
364 if (find_i2c_adapter_num(i2c_dev->type) == -ENODEV) { in chromeos_laptop_probe()
370 if (i2c_dev->add(i2c_dev->type) == -EAGAIN) { in chromeos_laptop_probe()
375 if (++i2c_dev->tries < MAX_I2C_DEVICE_DEFERRALS) { in chromeos_laptop_probe()
381 i2c_dev->state = TIMEDOUT; in chromeos_laptop_probe()
384 i2c_dev->state = PROBED; in chromeos_laptop_probe()
/drivers/nfc/pn544/
Di2c.c151 struct i2c_client *i2c_dev; member
195 nfc_info(&phy->i2c_dev->dev, "Detecting nfc_en polarity\n"); in pn544_hci_i2c_platform_init()
213 dev_dbg(&phy->i2c_dev->dev, "Sending reset cmd\n"); in pn544_hci_i2c_platform_init()
214 ret = i2c_master_send(phy->i2c_dev, rset_cmd, count); in pn544_hci_i2c_platform_init()
216 nfc_info(&phy->i2c_dev->dev, in pn544_hci_i2c_platform_init()
224 nfc_err(&phy->i2c_dev->dev, in pn544_hci_i2c_platform_init()
299 struct i2c_client *client = phy->i2c_dev; in pn544_hci_i2c_write()
363 struct i2c_client *client = phy->i2c_dev; in pn544_hci_i2c_read()
421 struct i2c_client *client = phy->i2c_dev; in pn544_hci_i2c_fw_read_status()
489 if (!phy || irq != phy->i2c_dev->irq) { in pn544_hci_i2c_irq_thread_fn()
[all …]
/drivers/nfc/microread/
Di2c.c50 struct i2c_client *i2c_dev; member
120 struct i2c_client *client = phy->i2c_dev; in microread_i2c_write()
157 struct i2c_client *client = phy->i2c_dev; in microread_i2c_read()
218 if (!phy || irq != phy->i2c_dev->irq) { in microread_i2c_irq_thread_fn()
223 client = phy->i2c_dev; in microread_i2c_irq_thread_fn()
272 phy->i2c_dev = client; in microread_i2c_probe()
/drivers/nfc/st21nfcb/
Di2c.c50 struct i2c_client *i2c_dev; member
102 struct i2c_client *client = phy->i2c_dev; in st21nfcb_nci_i2c_write()
144 struct i2c_client *client = phy->i2c_dev; in st21nfcb_nci_i2c_read()
198 if (!phy || irq != phy->i2c_dev->irq) { in st21nfcb_nci_irq_thread_fn()
203 client = phy->i2c_dev; in st21nfcb_nci_irq_thread_fn()
345 phy->i2c_dev = client; in st21nfcb_nci_i2c_probe()
/drivers/media/usb/em28xx/
Dem28xx-input.c84 static int em28xx_get_key_terratec(struct i2c_client *i2c_dev, in em28xx_get_key_terratec() argument
90 if (1 != i2c_master_recv(i2c_dev, &b, 1)) in em28xx_get_key_terratec()
108 static int em28xx_get_key_em_haup(struct i2c_client *i2c_dev, in em28xx_get_key_em_haup() argument
115 size = i2c_master_recv(i2c_dev, buf, sizeof(buf)); in em28xx_get_key_em_haup()
138 static int em28xx_get_key_pinnacle_usb_grey(struct i2c_client *i2c_dev, in em28xx_get_key_pinnacle_usb_grey() argument
145 if (3 != i2c_master_recv(i2c_dev, buf, 3)) in em28xx_get_key_pinnacle_usb_grey()
156 static int em28xx_get_key_winfast_usbii_deluxe(struct i2c_client *i2c_dev, in em28xx_get_key_winfast_usbii_deluxe() argument
161 struct i2c_msg msg[] = { { .addr = i2c_dev->addr, .flags = 0, .buf = &subaddr, .len = 1}, in em28xx_get_key_winfast_usbii_deluxe()
162 { .addr = i2c_dev->addr, .flags = I2C_M_RD, .buf = &keydetect, .len = 1} }; in em28xx_get_key_winfast_usbii_deluxe()
165 if (2 != i2c_transfer(i2c_dev->adapter, msg, 2)) in em28xx_get_key_winfast_usbii_deluxe()
[all …]
/drivers/nfc/st21nfca/
Di2c.c71 struct i2c_client *i2c_dev; member
120 r = i2c_master_send(phy->i2c_dev, reboot_cmd, in st21nfca_hci_platform_init()
132 r = i2c_master_recv(phy->i2c_dev, tmp, in st21nfca_hci_platform_init()
206 struct i2c_client *client = phy->i2c_dev; in st21nfca_hci_i2c_write()
374 struct i2c_client *client = phy->i2c_dev; in st21nfca_hci_i2c_read()
449 if (!phy || irq != phy->i2c_dev->irq) { in st21nfca_hci_irq_thread_fn()
454 client = phy->i2c_dev; in st21nfca_hci_irq_thread_fn()
628 phy->i2c_dev = client; in st21nfca_hci_i2c_probe()
/drivers/media/pci/bt8xx/
Dbttv-input.c381 struct i2c_client *i2c_dev; in init_bttv_i2c_ir() local
401 i2c_dev = i2c_new_device(&btv->c.i2c_adap, &info); in init_bttv_i2c_ir()
411 i2c_dev = i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL); in init_bttv_i2c_ir()
413 if (NULL == i2c_dev) in init_bttv_i2c_ir()
/drivers/scsi/esas2r/
Datioctl.h802 u8 i2c_dev; member