/linux/Documentation/i2c/ |
H A D | i2c-sysfs.rst | 4 Linux I2C Sysfs 10 I2C topology can be complex because of the existence of I2C MUX 11 (I2C Multiplexer). The Linux 12 kernel abstracts the MUX channels into logical I2C bus numbers. However, there 13 is a gap of knowledge to map from the I2C bus physical number and MUX topology 14 to logical I2C bus number. This doc is aimed to fill in this gap, so the 16 the concept of logical I2C buses in the kernel, by knowing the physical I2C 17 topology and navigating through the I2C sysfs in Linux shell. This knowledge is 18 useful and essential to use ``i2c-tools`` for the purpose of development and 24 People who need to use Linux shell to interact with I2C subsystem on a system [all …]
|
/linux/drivers/i2c/busses/ |
H A D | Makefile | 3 # Makefile for the i2c bus drivers. 7 obj-$(CONFIG_I2C_SCMI) += i2c-scmi.o 9 # Auxiliary I2C/SMBus modules 10 obj-$(CONFIG_I2C_CCGX_UCSI) += i2c-ccgx-ucsi.o 13 obj-$(CONFIG_I2C_ALI1535) += i2c-ali1535.o 14 obj-$(CONFIG_I2C_ALI1563) += i2c-ali1563.o 15 obj-$(CONFIG_I2C_ALI15X3) += i2c-ali15x3.o 16 obj-$(CONFIG_I2C_AMD756) += i2c-amd756.o 17 obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o 18 obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o [all …]
|
H A D | i2c-pxa.c | 5 * I2C adapter for the PXA I2C bus access. 24 #include <linux/i2c.h> 34 #include <linux/platform_data/i2c-pxa.h> 38 /* I2C register field definitions */ 112 * 8 ITEIE 1 (Enables the I2C unit to interrupt when transmit buffer empty) 113 * 7 GCD 1 (Disables i2c unit response to general call messages as a slave) 115 * 5 SCLE 1 (Enables the i2c clock output for master mode (drives SCL) 124 /* I2C status register init values 155 /* I2C register layout definitions */ 207 { .compatible = "mrvl,pxa-i2c", .data = (void *)REGS_PXA2XX }, [all …]
|
H A D | i2c-digicolor.c | 3 * I2C bus driver for Conexant Digicolor SoCs 13 #include <linux/i2c.h> 71 static void dc_i2c_cmd(struct dc_i2c *i2c, u8 cmd) in dc_i2c_cmd() argument 73 writeb_relaxed(cmd | II_COMMAND_GO, i2c->regs + II_COMMAND); in dc_i2c_cmd() 86 static void dc_i2c_data(struct dc_i2c *i2c, u8 data) in dc_i2c_data() argument 88 writeb_relaxed(data, i2c->regs + II_DATA); in dc_i2c_data() 91 static void dc_i2c_write_byte(struct dc_i2c *i2c, u8 byte) in dc_i2c_write_byte() argument 93 dc_i2c_data(i2c, byte); in dc_i2c_write_byte() 94 dc_i2c_cmd(i2c, II_CMD_SEND_ACK); in dc_i2c_write_byte() 97 static void dc_i2c_write_buf(struct dc_i2c *i2c) in dc_i2c_write_buf() argument [all …]
|
H A D | i2c-xiic.c | 3 * i2c-xiic.c 24 #include <linux/i2c.h> 27 #include <linux/platform_data/i2c-xiic.h> 34 #define DRIVER_NAME "xiic-i2c" 56 * struct xiic_i2c - Internal representation of the XIIC I2C bus 75 * @input_clk: Input clock to I2C controller 76 * @i2c_clk: I2C SCL frequency 106 * struct timing_regs - AXI I2C timing registers that depend on I2C spec 121 /* Reg values in ns derived from I2C spec and AXI I2C PG for different frequencies */ 148 * setting i2c clock frequency for the line. [all …]
|
H A D | i2c-jz4780.c | 3 * Ingenic JZ4780 I2C bus driver 15 #include <linux/i2c.h> 171 static inline unsigned short jz4780_i2c_readw(struct jz4780_i2c *i2c, in jz4780_i2c_readw() argument 174 return readw(i2c->iomem + offset); in jz4780_i2c_readw() 177 static inline void jz4780_i2c_writew(struct jz4780_i2c *i2c, in jz4780_i2c_writew() argument 180 writew(val, i2c->iomem + offset); in jz4780_i2c_writew() 183 static int jz4780_i2c_disable(struct jz4780_i2c *i2c) in jz4780_i2c_disable() argument 188 jz4780_i2c_writew(i2c, JZ4780_I2C_ENB, 0); in jz4780_i2c_disable() 191 regval = jz4780_i2c_readw(i2c, JZ4780_I2C_ENSTA); in jz4780_i2c_disable() 198 dev_err(&i2c->adap.dev, "disable failed: ENSTA=0x%04x\n", regval); in jz4780_i2c_disable() [all …]
|
H A D | i2c-s3c2410.c | 2 /* linux/drivers/i2c/busses/i2c-s3c2410.c 7 * S3C2410 I2C Controller 13 #include <linux/i2c.h> 34 #include <linux/platform_data/i2c-s3c2410.h> 87 /* i2c controller state */ 125 .name = "s3c2410-i2c", 128 .name = "s3c2440-i2c", 131 .name = "s3c2440-hdmiphy-i2c", 137 static void i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat); 141 { .compatible = "samsung,s3c2410-i2c", .data = (void *)0 }, [all …]
|
H A D | i2c-synquacer.c | 12 #include <linux/i2c.h> 25 /* I2C register address definitions */ 35 /* I2C register bit definitions */ 113 /* min I2C clock frequency 14M */ 115 /* max I2C clock frequency 200M */ 117 /* I2C clock frequency 18M */ 148 static inline int is_lastmsg(struct synquacer_i2c *i2c) in is_lastmsg() argument 150 return i2c->msg_idx >= (i2c->msg_num - 1); in is_lastmsg() 153 static inline int is_msglast(struct synquacer_i2c *i2c) in is_msglast() argument 155 return i2c->msg_ptr == (i2c->msg->len - 1); in is_msglast() [all …]
|
H A D | i2c-mt65xx.c | 14 #include <linux/i2c.h> 85 #define I2C_DRV_NAME "i2c-mt65xx" 88 * enum i2c_mt65xx_clks - Clocks enumeration for MT65XX I2C 90 * @I2C_MT65XX_CLK_MAIN: main clock for i2c bus 91 * @I2C_MT65XX_CLK_DMA: DMA clock for i2c via DMA 92 * @I2C_MT65XX_CLK_PMIC: PMIC clock for i2c from PMIC 93 * @I2C_MT65XX_CLK_ARB: Arbitrator clock for i2c 287 struct i2c_adapter adap; /* i2c host adapter */ 292 /* set in i2c probe */ 293 void __iomem *base; /* i2c base addr */ [all …]
|
H A D | Kconfig | 6 menu "I2C Hardware Bus support" 29 will be called i2c-ali1535. 41 will be called i2c-ali1563. 48 Acer Labs Inc. (ALI) M1514 and M1543 motherboard I2C interfaces. 51 will be called i2c-ali15x3. 58 756/766/768 mainboard I2C interfaces. The driver also includes 59 support for the first (SMBus 1.0) I2C interface of the AMD 8111 and 60 the nVidia nForce I2C interface. 63 will be called i2c-amd756. 70 second (SMBus 2.0) AMD 8111 mainboard I2C interface. [all …]
|
H A D | i2c-thunderx-pcidrv.c | 2 * Cavium ThunderX i2c driver. 16 #include <linux/i2c.h> 17 #include <linux/i2c-smbus.h> 24 #include "i2c-octeon-core.h" 26 #define DRV_NAME "i2c-thunderx" 41 static void thunder_i2c_int_enable(struct octeon_i2c *i2c) in thunder_i2c_int_enable() argument 44 i2c->twsi_base + TWSI_INT_ENA_W1S); in thunder_i2c_int_enable() 50 static void thunder_i2c_int_disable(struct octeon_i2c *i2c) in thunder_i2c_int_disable() argument 53 i2c->twsi_base + TWSI_INT_ENA_W1C); in thunder_i2c_int_disable() 56 static void thunder_i2c_hlc_int_enable(struct octeon_i2c *i2c) in thunder_i2c_hlc_int_enable() argument [all …]
|
H A D | i2c-octeon-core.c | 7 * This file contains the shared part of the driver for the i2c adapter in 16 #include <linux/i2c.h> 22 #include "i2c-octeon-core.h" 31 struct octeon_i2c *i2c = dev_id; in octeon_i2c_isr() local 33 i2c->int_disable(i2c); in octeon_i2c_isr() 34 wake_up(&i2c->queue); in octeon_i2c_isr() 39 static bool octeon_i2c_test_iflg(struct octeon_i2c *i2c) in octeon_i2c_test_iflg() argument 41 return (octeon_i2c_ctl_read(i2c) & TWSI_CTL_IFLG); in octeon_i2c_test_iflg() 46 * @i2c: The struct octeon_i2c 50 static int octeon_i2c_wait(struct octeon_i2c *i2c) in octeon_i2c_wait() argument [all …]
|
H A D | i2c-mpc.c | 3 * This is a combined i2c adapter and algorithm driver for the 5 * the same I2C unit (8240, 8245, 85xx). 25 #include <linux/i2c.h> 109 void (*setup)(struct device_node *node, struct mpc_i2c *i2c, u32 clock); 112 static inline void writeccr(struct mpc_i2c *i2c, u32 x) in writeccr() argument 114 writeb(x, i2c->base + MPC_I2C_CR); in writeccr() 122 static void mpc_i2c_fixup(struct mpc_i2c *i2c) in mpc_i2c_fixup() argument 128 writeccr(i2c, 0); in mpc_i2c_fixup() 129 writeb(0, i2c->base + MPC_I2C_SR); /* clear any status bits */ in mpc_i2c_fixup() 130 writeccr(i2c, CCR_MEN | CCR_MSTA); /* START */ in mpc_i2c_fixup() [all …]
|
H A D | i2c-viai2c-common.c | 3 #include "i2c-viai2c-common.h" 5 int viai2c_wait_bus_not_busy(struct viai2c *i2c) in viai2c_wait_bus_not_busy() argument 10 while (!(readw(i2c->base + VIAI2C_REG_CSR) & VIAI2C_CSR_READY_MASK)) { in viai2c_wait_bus_not_busy() 12 dev_warn(i2c->dev, "timeout waiting for bus ready\n"); in viai2c_wait_bus_not_busy() 22 static int viai2c_write(struct viai2c *i2c, struct i2c_msg *pmsg, int last) in viai2c_write() argument 24 u16 val, tcr_val = i2c->tcr; in viai2c_write() 26 i2c->last = last; in viai2c_write() 33 i2c->xfered_len = -1; in viai2c_write() 34 writew(0, i2c->base + VIAI2C_REG_CDR); in viai2c_write() 36 writew(pmsg->buf[0] & 0xFF, i2c->base + VIAI2C_REG_CDR); in viai2c_write() [all …]
|
H A D | i2c-mchp-pci1xxxx.c | 3 * Microchip PCI1XXXX I2C adapter driver for PCIe Switch 4 * which has I2C controller in one of its downstream functions 14 #include <linux/i2c.h> 15 #include <linux/i2c-smbus.h> 103 * BUS_CLK_XK_LOW_PERIOD_TICKS field defines the number of I2C Baud Clock 104 * periods that make up the low phase of the I2C/SMBus bus clock at X KHz. 111 * BUS_CLK_XK_HIGH_PERIOD_TICKS field defines the number of I2C Baud Clock 112 * periods that make up the high phase of the I2C/SMBus bus clock at X KHz. 334 static int set_sys_lock(struct pci1xxxx_i2c *i2c) in set_sys_lock() argument 336 void __iomem *p = i2c->i2c_base + SMB_GPR_LOCK_REG; in set_sys_lock() [all …]
|
/linux/drivers/media/pci/netup_unidvb/ |
H A D | netup_unidvb_i2c.c | 5 * Internal I2C bus driver for NetUP Universal Dual DVB-CI 65 irqreturn_t netup_i2c_interrupt(struct netup_i2c *i2c) in netup_i2c_interrupt() argument 71 spin_lock_irqsave(&i2c->lock, flags); in netup_i2c_interrupt() 72 reg = readw(&i2c->regs->twi_ctrl0_stat); in netup_i2c_interrupt() 73 writew(reg & ~TWI_IRQEN, &i2c->regs->twi_ctrl0_stat); in netup_i2c_interrupt() 74 dev_dbg(i2c->adap.dev.parent, in netup_i2c_interrupt() 77 dev_dbg(i2c->adap.dev.parent, in netup_i2c_interrupt() 79 i2c->state = STATE_DONE; in netup_i2c_interrupt() 83 dev_dbg(i2c->adap.dev.parent, in netup_i2c_interrupt() 85 i2c->state = STATE_ERROR; in netup_i2c_interrupt() [all …]
|
/linux/drivers/i2c/ |
H A D | Kconfig | 3 # I2C subsystem configuration 6 menu "I2C support" 8 config I2C config 9 tristate "I2C support" 13 I2C (pronounce: I-squared-C) is a slow serial bus protocol used in 15 or System Management Bus is a subset of the I2C protocol. More 16 information is contained in the directory <file:Documentation/i2c/>, 19 Both I2C and SMBus are supported here. You will need this for 22 If you want I2C support, you should say Y here and also to the 25 This I2C support can also be built as a module. If so, the module [all …]
|
/linux/Documentation/devicetree/bindings/i2c/ |
H A D | nvidia,tegra20-i2c.yaml | 4 $id: http://devicetree.org/schemas/i2c/nvidia,tegra20-i2c.yaml# 11 title: NVIDIA Tegra I2C controller driver 16 - description: Tegra20 has 4 generic I2C controller. This can support 17 master and slave mode of I2C communication. The i2c-tegra driver 18 only support master mode of I2C communication. Driver of I2C 19 controller is only compatible with "nvidia,tegra20-i2c". 20 const: nvidia,tegra20-i2c 21 - description: Tegra20 has specific I2C controller called as DVC I2C 22 controller. This only support master mode of I2C communication. 24 generic I2C controller. Driver of DVC I2C controller is only [all …]
|
H A D | renesas,rcar-i2c.yaml | 4 $id: http://devicetree.org/schemas/i2c/renesas,rcar-i2c.yaml# 7 title: Renesas R-Car I2C Controller 17 - renesas,i2c-r8a7778 # R-Car M1A 18 - renesas,i2c-r8a7779 # R-Car H1 19 - const: renesas,rcar-gen1-i2c # R-Car Gen1 23 - renesas,i2c-r8a7742 # RZ/G1H 24 - renesas,i2c-r8a7743 # RZ/G1M 25 - renesas,i2c-r8a7744 # RZ/G1N 26 - renesas,i2c-r8a7745 # RZ/G1E 27 - renesas,i2c-r8a77470 # RZ/G1C [all …]
|
/linux/sound/soc/codecs/ |
H A D | Kconfig | 2 # Helper to resolve issues with configs that have SPI enabled but I2C 3 # modular, meaning we can't build the codec driver in with I2C support. 8 default m if I2C=m 9 default y if I2C=y 439 depends on I2C 458 tristate "Analog Devices ADAU1372 CODEC (I2C)" 459 depends on I2C 471 depends on I2C 476 depends on I2C 489 tristate "Analog Devices AU1761 CODEC - I2C" [all …]
|
H A D | wm2000.c | 29 #include <linux/i2c.h> 61 struct i2c_client *i2c; member 81 static int wm2000_write(struct i2c_client *i2c, unsigned int reg, in wm2000_write() argument 84 struct wm2000_priv *wm2000 = i2c_get_clientdata(i2c); in wm2000_write() 90 struct i2c_client *i2c = wm2000->i2c; in wm2000_reset() local 92 wm2000_write(i2c, WM2000_REG_SYS_CTL2, WM2000_ANC_ENG_CLR); in wm2000_reset() 93 wm2000_write(i2c, WM2000_REG_SYS_CTL2, WM2000_RAM_CLR); in wm2000_reset() 94 wm2000_write(i2c, WM2000_REG_ID1, 0); in wm2000_reset() 99 static int wm2000_poll_bit(struct i2c_client *i2c, in wm2000_poll_bit() argument 102 struct wm2000_priv *wm2000 = i2c_get_clientdata(i2c); in wm2000_poll_bit() [all …]
|
/linux/arch/arm/boot/dts/aspeed/ |
H A D | aspeed-bmc-facebook-cmm.dts | 319 * I2C bus reserved for communication with COM-E. 326 * I2C bus to Line Cards and Fabric Cards. 331 i2c-mux@77 { 336 i2c-mux-idle-disconnect; 339 imux16: i2c@0 { 344 i2c-mux@70 { 349 i2c-mux-idle-disconnect; 351 imux104: i2c@0 { 356 imux105: i2c@1 { 361 imux106: i2c@2 { [all …]
|
H A D | aspeed-bmc-facebook-minipack.dts | 23 * i2c switch 2-0070, pca9548, 8 child channels assigned 36 * i2c switch 8-0070, pca9548, 8 child channels assigned 49 * i2c switch 9-0070, pca9548, 8 child channels assigned 62 * i2c switch 11-0070, pca9548, 8 child channels assigned 75 * I2C Switch 24-0071 (channel #0 of 8-0070): 8 channels for 88 * I2C Switch 25-0072 (channel #1 of 8-0070): 8 channels for 101 * I2C Switch 26-0076 (channel #2 of 8-0070): 8 channels for 114 * I2C Switch 27-0076 (channel #3 of 8-0070): 8 channels for 127 * I2C Switch 40-0073 (channel #0 of 11-0070): connecting 140 * I2C Switch 41-0073 (channel #1 of 11-0070): connecting [all …]
|
/linux/drivers/media/pci/ddbridge/ |
H A D | ddbridge-i2c.c | 3 * ddbridge-i2c.c: Digital Devices bridge i2c driver 20 #include <linux/i2c.h> 25 #include "ddbridge-i2c.h" 31 static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd) in ddb_i2c_cmd() argument 33 struct ddb *dev = i2c->dev; in ddb_i2c_cmd() 37 ddbwritel(dev, (adr << 9) | cmd, i2c->regs + I2C_COMMAND); in ddb_i2c_cmd() 38 stat = wait_for_completion_timeout(&i2c->completion, HZ); in ddb_i2c_cmd() 39 val = ddbreadl(dev, i2c->regs + I2C_COMMAND); in ddb_i2c_cmd() 41 dev_err(dev->dev, "I2C timeout, card %d, port %d, link %u\n", in ddb_i2c_cmd() 42 dev->nr, i2c->nr, i2c->link); in ddb_i2c_cmd() [all …]
|
/linux/drivers/i2c/muxes/ |
H A D | Kconfig | 3 # Multiplexer I2C chip drivers configuration 6 menu "Multiplexer I2C Chip support" 10 tristate "GPIO-based I2C arbitration" 15 I2C multimaster arbitration scheme using GPIOs and a challenge & 20 will be called i2c-arb-gpio-challenge. 23 tristate "GPIO-based I2C multiplexer" 27 GPIO based I2C multiplexer. This driver provides access to 28 I2C busses connected through a MUX, which is controlled 32 will be called i2c-mux-gpio. 35 tristate "General Purpose I2C multiplexer" [all …]
|