Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'i2c-for-6.11-rc1-try2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
"The I2C core gains documentation updates for the testunit, a cleanup
regarding unneeded 'driver_data' and more sanity checks in the char
device.

For the host drivers, this release includes significant updates, with
the primary change being the renaming from "master/slave" to
"controller/target" to adhere to I2C v7 and SMBus 3.2 standards.

New Support:

- Added support for Intel Arrow Lake-H
- Added I2C support in the Arioha SoC by linking the Mediatek I2C
controller

Cleanups:

- Added the MODULE_DESCRIPTION() macro, resolving a modpost warning
in the ALi 1563 Southbridge driver.
- Constified the regmap_config declaration in the i2c-designware
driver.
- Improved the coding style in the Renesas R-Car driver by removing
unnecessary semicolons after brackets.

General improvements:

- In the OMAP device, replaced NOIRQ_SYSTEM_SLEEP_PM_OPS with
RUNTIME_PM_OPS to enable waking up the controller during suspend()
before suspend_noirq() kicks in.
- Improved logging in the Xilinx driver.
- Added a warning (WARN()) in the Renesas R-Car driver for spurious
interrupts.

DTS Changes:

- Removed address-cell and size-cell from the Atmel at91sam, nVidia
Tegra 20, and Samsung S3c2410 devices.
- Fixed Texas Instruments OMAP4 I2C controller to comply with the
i2c-controller.yaml schema.
- Improved indentation in DTS examples for several I2C devices.
- Converted the NXP LPC1788 binding to the dt-schema.
- Added documentation for the compatible string thead,th1520-i2c.
- Added the "power-domains" property for the Meson I2C driver.

AT24 EEPROM driver changes:

- add support for two new Microchip models
- document even more new models in DT bindings (those use fallback
compatibles so no code changes)"

* tag 'i2c-for-6.11-rc1-try2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (87 commits)
i2c: document new callbacks in i2c_algorithm
dt-bindings: i2c: amlogic,meson6-i2c: add optional power-domains
dt-bindings: i2c: at91: Add sama7d65 compatible string
i2c: st: reword according to newest specification
i2c: cpm: reword according to newest specification
i2c: virtio: reword according to newest specification
i2c: nvidia-gpu: reword according to newest specification
i2c: viai2c: reword according to newest specification
i2c: viperboard: reword according to newest specification
i2c: uniphier: reword according to newest specification
i2c: uniphier-f: reword according to newest specification
i2c: tiny-usb: reword according to newest specification
i2c: thunderx-pcidrv: reword according to newest specification
i2c: tegra-bpmp: reword according to newest specification
i2c: taos-evm: reword according to newest specification
i2c: sun6i-p2wi: reword according to newest specification
i2c: stm32f4: reword according to newest specification
i2c: sprd: reword according to newest specification
i2c: sis5595: reword according to newest specification
i2c: rzv2m: reword according to newest specification
...

+741 -636
+13 -5
Documentation/devicetree/bindings/eeprom/at24.yaml
··· 18 18 properties: 19 19 compatible: 20 20 contains: 21 - pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$" 21 + anyOf: 22 + - pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$" 23 + - enum: ["microchip,24aa025e48", "microchip,24aa025e64"] 22 24 required: 23 25 - compatible 24 26 ··· 105 103 # These are special cases that don't conform to the above pattern. 106 104 # Each requires a standard at24 model as fallback. 107 105 - items: 108 - - const: belling,bl24c16a 109 - - const: atmel,24c16 110 - - items: 111 106 - enum: 112 107 - rohm,br24g01 113 108 - rohm,br24t01 ··· 121 122 - rohm,br24g04 122 123 - const: atmel,24c04 123 124 - items: 124 - - const: renesas,r1ex24016 125 + - enum: 126 + - belling,bl24c16a 127 + - renesas,r1ex24016 125 128 - const: atmel,24c16 126 129 - items: 127 130 - const: giantec,gt24c32a 128 131 - const: atmel,24c32 129 132 - items: 133 + - const: onnn,n24s64b 134 + - const: atmel,24c64 135 + - items: 130 136 - enum: 131 137 - renesas,r1ex24128 132 138 - samsung,s524ad0xd1 133 139 - const: atmel,24c128 140 + - items: 141 + - const: microchip,24aa025e48 142 + - items: 143 + - const: microchip,24aa025e64 134 144 - pattern: '^atmel,24c(32|64)d-wl$' # Actual vendor is st 135 145 136 146 label:
+3
Documentation/devicetree/bindings/i2c/amlogic,meson6-i2c.yaml
··· 30 30 clocks: 31 31 minItems: 1 32 32 33 + power-domains: 34 + maxItems: 1 35 + 33 36 required: 34 37 - compatible 35 38 - reg
+2 -8
Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
··· 26 26 - microchip,sam9x60-i2c 27 27 - items: 28 28 - enum: 29 + - microchip,sama7d65-i2c 29 30 - microchip,sama7g5-i2c 30 31 - microchip,sam9x7-i2c 31 32 - const: microchip,sam9x60-i2c ··· 36 35 37 36 interrupts: 38 37 maxItems: 1 39 - 40 - "#address-cells": 41 - const: 1 42 - 43 - "#size-cells": 44 - const: 0 45 38 46 39 clocks: 47 40 maxItems: 1 ··· 67 72 - compatible 68 73 - reg 69 74 - interrupts 70 - - "#address-cells" 71 - - "#size-cells" 72 75 - clocks 73 76 74 77 allOf: ··· 79 86 - atmel,sama5d4-i2c 80 87 - atmel,sama5d2-i2c 81 88 - microchip,sam9x60-i2c 89 + - microchip,sama7d65-i2c 82 90 - microchip,sama7g5-i2c 83 91 then: 84 92 properties:
+14 -14
Documentation/devicetree/bindings/i2c/brcm,brcmstb-i2c.yaml
··· 76 76 77 77 examples: 78 78 - | 79 - bsca: i2c@f0406200 { 80 - clock-frequency = <390000>; 81 - compatible = "brcm,brcmstb-i2c"; 82 - interrupt-parent = <&irq0_intc>; 83 - reg = <0xf0406200 0x58>; 84 - interrupts = <0x18>; 85 - interrupt-names = "upg_bsca"; 86 - }; 79 + bsca: i2c@f0406200 { 80 + compatible = "brcm,brcmstb-i2c"; 81 + reg = <0xf0406200 0x58>; 82 + clock-frequency = <390000>; 83 + interrupt-parent = <&irq0_intc>; 84 + interrupts = <0x18>; 85 + interrupt-names = "upg_bsca"; 86 + }; 87 87 88 88 - | 89 - ddc0: i2c@7ef04500 { 90 - compatible = "brcm,bcm2711-hdmi-i2c"; 91 - reg = <0x7ef04500 0x100>, <0x7ef00b00 0x300>; 92 - reg-names = "bsc", "auto-i2c"; 93 - clock-frequency = <390000>; 94 - }; 89 + ddc0: i2c@7ef04500 { 90 + compatible = "brcm,bcm2711-hdmi-i2c"; 91 + reg = <0x7ef04500 0x100>, <0x7ef00b00 0x300>; 92 + reg-names = "bsc", "auto-i2c"; 93 + clock-frequency = <390000>; 94 + }; 95 95 96 96 ...
+53 -53
Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.yaml
··· 109 109 // Example for a bus to be demuxed. It contains various I2C clients for 110 110 // HDMI, so the bus is named "i2c-hdmi": 111 111 i2chdmi: i2c-mux3 { 112 - compatible = "i2c-demux-pinctrl"; 113 - i2c-parent = <&iic2>, <&i2c2>, <&gpioi2c2>; 114 - i2c-bus-name = "i2c-hdmi"; 115 - #address-cells = <1>; 116 - #size-cells = <0>; 112 + compatible = "i2c-demux-pinctrl"; 113 + i2c-parent = <&iic2>, <&i2c2>, <&gpioi2c2>; 114 + i2c-bus-name = "i2c-hdmi"; 115 + #address-cells = <1>; 116 + #size-cells = <0>; 117 117 118 - ak4643: codec@12 { 119 - compatible = "asahi-kasei,ak4643"; 120 - #sound-dai-cells = <0>; 121 - reg = <0x12>; 118 + ak4643: codec@12 { 119 + compatible = "asahi-kasei,ak4643"; 120 + #sound-dai-cells = <0>; 121 + reg = <0x12>; 122 + }; 123 + 124 + composite-in@20 { 125 + compatible = "adi,adv7180"; 126 + reg = <0x20>; 127 + 128 + port { 129 + adv7180: endpoint { 130 + bus-width = <8>; 131 + remote-endpoint = <&vin1ep0>; 132 + }; 122 133 }; 134 + }; 123 135 124 - composite-in@20 { 125 - compatible = "adi,adv7180"; 126 - reg = <0x20>; 136 + hdmi@39 { 137 + compatible = "adi,adv7511w"; 138 + reg = <0x39>; 139 + interrupt-parent = <&gpio1>; 140 + interrupts = <15 IRQ_TYPE_LEVEL_LOW>; 141 + clocks = <&cec_clock>; 142 + clock-names = "cec"; 127 143 128 - port { 129 - adv7180: endpoint { 130 - bus-width = <8>; 131 - remote-endpoint = <&vin1ep0>; 132 - }; 144 + avdd-supply = <&fixedregulator1v8>; 145 + dvdd-supply = <&fixedregulator1v8>; 146 + pvdd-supply = <&fixedregulator1v8>; 147 + dvdd-3v-supply = <&fixedregulator3v3>; 148 + bgvdd-supply = <&fixedregulator1v8>; 149 + 150 + adi,input-depth = <8>; 151 + adi,input-colorspace = "rgb"; 152 + adi,input-clock = "1x"; 153 + 154 + ports { 155 + #address-cells = <1>; 156 + #size-cells = <0>; 157 + 158 + port@0 { 159 + reg = <0>; 160 + adv7511_in: endpoint { 161 + remote-endpoint = <&lvds0_out>; 133 162 }; 134 - }; 163 + }; 135 164 136 - hdmi@39 { 137 - compatible = "adi,adv7511w"; 138 - reg = <0x39>; 139 - interrupt-parent = <&gpio1>; 140 - interrupts = <15 IRQ_TYPE_LEVEL_LOW>; 141 - clocks = <&cec_clock>; 142 - clock-names = "cec"; 143 - 144 - avdd-supply = <&fixedregulator1v8>; 145 - dvdd-supply = <&fixedregulator1v8>; 146 - pvdd-supply = <&fixedregulator1v8>; 147 - dvdd-3v-supply = <&fixedregulator3v3>; 148 - bgvdd-supply = <&fixedregulator1v8>; 149 - 150 - adi,input-depth = <8>; 151 - adi,input-colorspace = "rgb"; 152 - adi,input-clock = "1x"; 153 - 154 - ports { 155 - #address-cells = <1>; 156 - #size-cells = <0>; 157 - 158 - port@0 { 159 - reg = <0>; 160 - adv7511_in: endpoint { 161 - remote-endpoint = <&lvds0_out>; 162 - }; 163 - }; 164 - 165 - port@1 { 166 - reg = <1>; 167 - adv7511_out: endpoint { 168 - remote-endpoint = <&hdmi_con_out>; 169 - }; 170 - }; 165 + port@1 { 166 + reg = <1>; 167 + adv7511_out: endpoint { 168 + remote-endpoint = <&hdmi_con_out>; 171 169 }; 170 + }; 172 171 }; 172 + }; 173 173 };
-33
Documentation/devicetree/bindings/i2c/i2c-lpc2k.txt
··· 1 - NXP I2C controller for LPC2xxx/178x/18xx/43xx 2 - 3 - Required properties: 4 - - compatible: must be "nxp,lpc1788-i2c" 5 - - reg: physical address and length of the device registers 6 - - interrupts: a single interrupt specifier 7 - - clocks: clock for the device 8 - - #address-cells: should be <1> 9 - - #size-cells: should be <0> 10 - 11 - Optional properties: 12 - - clock-frequency: the desired I2C bus clock frequency in Hz; in 13 - absence of this property the default value is used (100 kHz). 14 - 15 - Example: 16 - i2c0: i2c@400a1000 { 17 - compatible = "nxp,lpc1788-i2c"; 18 - reg = <0x400a1000 0x1000>; 19 - interrupts = <18>; 20 - clocks = <&ccu1 CLK_APB1_I2C0>; 21 - #address-cells = <1>; 22 - #size-cells = <0>; 23 - }; 24 - 25 - &i2c0 { 26 - clock-frequency = <400000>; 27 - 28 - lm75@48 { 29 - compatible = "nxp,lm75"; 30 - reg = <0x48>; 31 - }; 32 - }; 33 -
-6
Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml
··· 87 87 interrupts: 88 88 maxItems: 1 89 89 90 - '#address-cells': 91 - const: 1 92 - 93 - '#size-cells': 94 - const: 0 95 - 96 90 clocks: 97 91 minItems: 1 98 92 maxItems: 2
+54
Documentation/devicetree/bindings/i2c/nxp,lpc1788-i2c.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/i2c/nxp,lpc1788-i2c.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NXP I2C controller for LPC2xxx/178x/18xx/43xx 8 + 9 + maintainers: 10 + - Vladimir Zapolskiy <vz@mleia.com> 11 + 12 + allOf: 13 + - $ref: /schemas/i2c/i2c-controller.yaml# 14 + 15 + properties: 16 + compatible: 17 + const: nxp,lpc1788-i2c 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + clocks: 26 + maxItems: 1 27 + 28 + clock-frequency: 29 + description: the desired I2C bus clock frequency in Hz 30 + default: 100000 31 + 32 + resets: 33 + maxItems: 1 34 + 35 + required: 36 + - compatible 37 + - reg 38 + - interrupts 39 + - clocks 40 + 41 + unevaluatedProperties: false 42 + 43 + examples: 44 + - | 45 + #include "dt-bindings/clock/lpc18xx-ccu.h" 46 + 47 + i2c@400a1000 { 48 + compatible = "nxp,lpc1788-i2c"; 49 + reg = <0x400a1000 0x1000>; 50 + interrupts = <18>; 51 + clocks = <&ccu1 CLK_APB1_I2C0>; 52 + #address-cells = <1>; 53 + #size-cells = <0>; 54 + };
+7 -7
Documentation/devicetree/bindings/i2c/renesas,iic-emev2.yaml
··· 44 44 #include <dt-bindings/interrupt-controller/arm-gic.h> 45 45 46 46 iic0: i2c@e0070000 { 47 - #address-cells = <1>; 48 - #size-cells = <0>; 49 - compatible = "renesas,iic-emev2"; 50 - reg = <0xe0070000 0x28>; 51 - interrupts = <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>; 52 - clocks = <&iic0_sclk>; 53 - clock-names = "sclk"; 47 + compatible = "renesas,iic-emev2"; 48 + reg = <0xe0070000 0x28>; 49 + interrupts = <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>; 50 + clocks = <&iic0_sclk>; 51 + clock-names = "sclk"; 52 + #address-cells = <1>; 53 + #size-cells = <0>; 54 54 };
+10 -10
Documentation/devicetree/bindings/i2c/renesas,rcar-i2c.yaml
··· 153 153 #include <dt-bindings/power/r8a7791-sysc.h> 154 154 155 155 i2c0: i2c@e6508000 { 156 - #address-cells = <1>; 157 - #size-cells = <0>; 158 - compatible = "renesas,i2c-r8a7791", "renesas,rcar-gen2-i2c"; 159 - reg = <0xe6508000 0x40>; 160 - interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>; 161 - clock-frequency = <400000>; 162 - clocks = <&cpg CPG_MOD 931>; 163 - power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 164 - resets = <&cpg 931>; 165 - i2c-scl-internal-delay-ns = <6>; 156 + compatible = "renesas,i2c-r8a7791", "renesas,rcar-gen2-i2c"; 157 + reg = <0xe6508000 0x40>; 158 + interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>; 159 + clock-frequency = <400000>; 160 + clocks = <&cpg CPG_MOD 931>; 161 + power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 162 + resets = <&cpg 931>; 163 + i2c-scl-internal-delay-ns = <6>; 164 + #address-cells = <1>; 165 + #size-cells = <0>; 166 166 };
+17 -17
Documentation/devicetree/bindings/i2c/renesas,riic.yaml
··· 97 97 #include <dt-bindings/interrupt-controller/arm-gic.h> 98 98 99 99 i2c0: i2c@fcfee000 { 100 - compatible = "renesas,riic-r7s72100", "renesas,riic-rz"; 101 - reg = <0xfcfee000 0x44>; 102 - interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>, 103 - <GIC_SPI 158 IRQ_TYPE_EDGE_RISING>, 104 - <GIC_SPI 159 IRQ_TYPE_EDGE_RISING>, 105 - <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>, 106 - <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>, 107 - <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>, 108 - <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>, 109 - <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>; 110 - interrupt-names = "tei", "ri", "ti", "spi", "sti", "naki", "ali", 111 - "tmoi"; 112 - clocks = <&mstp9_clks R7S72100_CLK_I2C0>; 113 - clock-frequency = <100000>; 114 - power-domains = <&cpg_clocks>; 115 - #address-cells = <1>; 116 - #size-cells = <0>; 100 + compatible = "renesas,riic-r7s72100", "renesas,riic-rz"; 101 + reg = <0xfcfee000 0x44>; 102 + interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>, 103 + <GIC_SPI 158 IRQ_TYPE_EDGE_RISING>, 104 + <GIC_SPI 159 IRQ_TYPE_EDGE_RISING>, 105 + <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>, 106 + <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>, 107 + <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>, 108 + <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>, 109 + <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>; 110 + interrupt-names = "tei", "ri", "ti", "spi", "sti", "naki", "ali", 111 + "tmoi"; 112 + clocks = <&mstp9_clks R7S72100_CLK_I2C0>; 113 + clock-frequency = <100000>; 114 + power-domains = <&cpg_clocks>; 115 + #address-cells = <1>; 116 + #size-cells = <0>; 117 117 };
+12 -12
Documentation/devicetree/bindings/i2c/renesas,rmobile-iic.yaml
··· 134 134 #include <dt-bindings/power/r8a7790-sysc.h> 135 135 136 136 iic0: i2c@e6500000 { 137 - compatible = "renesas,iic-r8a7790", "renesas,rcar-gen2-iic", 138 - "renesas,rmobile-iic"; 139 - reg = <0xe6500000 0x425>; 140 - interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; 141 - clocks = <&cpg CPG_MOD 318>; 142 - clock-frequency = <400000>; 143 - dmas = <&dmac0 0x61>, <&dmac0 0x62>, <&dmac1 0x61>, <&dmac1 0x62>; 144 - dma-names = "tx", "rx", "tx", "rx"; 145 - power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 146 - resets = <&cpg 318>; 147 - #address-cells = <1>; 148 - #size-cells = <0>; 137 + compatible = "renesas,iic-r8a7790", "renesas,rcar-gen2-iic", 138 + "renesas,rmobile-iic"; 139 + reg = <0xe6500000 0x425>; 140 + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; 141 + clocks = <&cpg CPG_MOD 318>; 142 + clock-frequency = <400000>; 143 + dmas = <&dmac0 0x61>, <&dmac0 0x62>, <&dmac1 0x61>, <&dmac1 0x62>; 144 + dma-names = "tx", "rx", "tx", "rx"; 145 + power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 146 + resets = <&cpg 318>; 147 + #address-cells = <1>; 148 + #size-cells = <0>; 149 149 };
-6
Documentation/devicetree/bindings/i2c/samsung,s3c2410-i2c.yaml
··· 26 26 - samsung,exynos850-i2c 27 27 - const: samsung,s3c2440-i2c 28 28 29 - '#address-cells': 30 - const: 1 31 - 32 29 clocks: 33 30 maxItems: 1 34 31 ··· 69 72 samsung,sysreg-phandle: 70 73 $ref: /schemas/types.yaml#/definitions/phandle 71 74 description: Pandle to syscon used to control the system registers. 72 - 73 - '#size-cells': 74 - const: 0 75 75 76 76 required: 77 77 - compatible
+4
Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
··· 33 33 - const: snps,designware-i2c 34 34 - description: Baikal-T1 SoC System I2C controller 35 35 const: baikal,bt1-sys-i2c 36 + - description: T-HEAD TH1520 SoCs I2C controller 37 + items: 38 + - const: thead,th1520-i2c 39 + - const: snps,designware-i2c 36 40 37 41 reg: 38 42 minItems: 1
+33 -33
Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml
··· 145 145 #include <dt-bindings/mfd/stm32f7-rcc.h> 146 146 #include <dt-bindings/clock/stm32fx-clock.h> 147 147 //Example 1 (with st,stm32f4-i2c compatible) 148 - i2c@40005400 { 149 - compatible = "st,stm32f4-i2c"; 150 - #address-cells = <1>; 151 - #size-cells = <0>; 152 - reg = <0x40005400 0x400>; 153 - interrupts = <31>, 154 - <32>; 155 - resets = <&rcc 277>; 156 - clocks = <&rcc 0 149>; 157 - }; 148 + i2c@40005400 { 149 + compatible = "st,stm32f4-i2c"; 150 + reg = <0x40005400 0x400>; 151 + interrupts = <31>, 152 + <32>; 153 + resets = <&rcc 277>; 154 + clocks = <&rcc 0 149>; 155 + #address-cells = <1>; 156 + #size-cells = <0>; 157 + }; 158 158 159 159 - | 160 160 #include <dt-bindings/mfd/stm32f7-rcc.h> 161 161 #include <dt-bindings/clock/stm32fx-clock.h> 162 162 //Example 2 (with st,stm32f7-i2c compatible) 163 - i2c@40005800 { 164 - compatible = "st,stm32f7-i2c"; 165 - #address-cells = <1>; 166 - #size-cells = <0>; 167 - reg = <0x40005800 0x400>; 168 - interrupts = <31>, 169 - <32>; 170 - resets = <&rcc STM32F7_APB1_RESET(I2C1)>; 171 - clocks = <&rcc 1 CLK_I2C1>; 172 - }; 163 + i2c@40005800 { 164 + compatible = "st,stm32f7-i2c"; 165 + reg = <0x40005800 0x400>; 166 + interrupts = <31>, 167 + <32>; 168 + resets = <&rcc STM32F7_APB1_RESET(I2C1)>; 169 + clocks = <&rcc 1 CLK_I2C1>; 170 + #address-cells = <1>; 171 + #size-cells = <0>; 172 + }; 173 173 174 174 - | 175 175 #include <dt-bindings/mfd/stm32f7-rcc.h> ··· 178 178 #include <dt-bindings/interrupt-controller/arm-gic.h> 179 179 #include <dt-bindings/clock/stm32mp1-clks.h> 180 180 #include <dt-bindings/reset/stm32mp1-resets.h> 181 - i2c@40013000 { 182 - compatible = "st,stm32mp15-i2c"; 183 - #address-cells = <1>; 184 - #size-cells = <0>; 185 - reg = <0x40013000 0x400>; 186 - interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>, 187 - <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>; 188 - clocks = <&rcc I2C2_K>; 189 - resets = <&rcc I2C2_R>; 190 - i2c-scl-rising-time-ns = <185>; 191 - i2c-scl-falling-time-ns = <20>; 192 - st,syscfg-fmp = <&syscfg 0x4 0x2>; 193 - }; 181 + i2c@40013000 { 182 + compatible = "st,stm32mp15-i2c"; 183 + reg = <0x40013000 0x400>; 184 + interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>, 185 + <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>; 186 + clocks = <&rcc I2C2_K>; 187 + resets = <&rcc I2C2_R>; 188 + i2c-scl-rising-time-ns = <185>; 189 + i2c-scl-falling-time-ns = <20>; 190 + st,syscfg-fmp = <&syscfg 0x4 0x2>; 191 + #address-cells = <1>; 192 + #size-cells = <0>; 193 + };
+26 -38
Documentation/devicetree/bindings/i2c/ti,omap4-i2c.yaml
··· 37 37 clock-names: 38 38 const: fck 39 39 40 - clock-frequency: true 41 - 42 40 power-domains: true 43 - 44 - "#address-cells": 45 - const: 1 46 - 47 - "#size-cells": 48 - const: 0 49 41 50 42 ti,hwmods: 51 43 description: ··· 47 55 $ref: /schemas/types.yaml#/definitions/string 48 56 deprecated: true 49 57 50 - # subnode's properties 51 - patternProperties: 52 - "@[0-9a-f]+$": 53 - type: object 54 - description: 55 - Flash device uses the below defined properties in the subnode. 56 - 57 58 required: 58 59 - compatible 59 60 - reg 60 61 - interrupts 61 62 62 - additionalProperties: false 63 + allOf: 64 + - $ref: /schemas/i2c/i2c-controller.yaml# 63 65 64 - if: 65 - properties: 66 - compatible: 67 - enum: 68 - - ti,omap2420-i2c 69 - - ti,omap2430-i2c 70 - - ti,omap3-i2c 71 - - ti,omap4-i2c 66 + - if: 67 + properties: 68 + compatible: 69 + enum: 70 + - ti,omap2420-i2c 71 + - ti,omap2430-i2c 72 + - ti,omap3-i2c 73 + - ti,omap4-i2c 72 74 73 - then: 74 - properties: 75 - ti,hwmods: 76 - items: 77 - - pattern: "^i2c([1-9])$" 75 + then: 76 + properties: 77 + ti,hwmods: 78 + items: 79 + - pattern: "^i2c([1-9])$" 78 80 79 - else: 80 - properties: 81 - ti,hwmods: false 81 + else: 82 + properties: 83 + ti,hwmods: false 84 + 85 + unevaluatedProperties: false 82 86 83 87 examples: 84 88 - | ··· 82 94 #include <dt-bindings/interrupt-controller/arm-gic.h> 83 95 84 96 main_i2c0: i2c@2000000 { 85 - compatible = "ti,j721e-i2c", "ti,omap4-i2c"; 86 - reg = <0x2000000 0x100>; 87 - interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>; 88 - #address-cells = <1>; 89 - #size-cells = <0>; 90 - }; 97 + compatible = "ti,j721e-i2c", "ti,omap4-i2c"; 98 + reg = <0x2000000 0x100>; 99 + interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>; 100 + #address-cells = <1>; 101 + #size-cells = <0>; 102 + };
+1
Documentation/i2c/busses/i2c-i801.rst
··· 48 48 * Intel Raptor Lake (PCH) 49 49 * Intel Meteor Lake (SOC and PCH) 50 50 * Intel Birch Stream (SOC) 51 + * Intel Arrow Lake (SOC) 51 52 52 53 Datasheets: Publicly available at the Intel website 53 54
+87 -40
Documentation/i2c/slave-testunit-backend.rst
··· 16 16 in a production build. And while there is some versioning and we try hard to 17 17 keep backward compatibility, there is no stable ABI guaranteed! 18 18 19 - Instantiating the device is regular. Example for bus 0, address 0x30: 19 + Instantiating the device is regular. Example for bus 0, address 0x30:: 20 20 21 - # echo "slave-testunit 0x1030" > /sys/bus/i2c/devices/i2c-0/new_device 21 + # echo "slave-testunit 0x1030" > /sys/bus/i2c/devices/i2c-0/new_device 22 22 23 23 After that, you will have a write-only device listening. Reads will just return 24 24 an 8-bit version number of the testunit. When writing, the device consists of 4 ··· 26 26 written to start a testcase, i.e. you usually write 4 bytes to the device. The 27 27 registers are: 28 28 29 - 0x00 CMD - which test to trigger 30 - 0x01 DATAL - configuration byte 1 for the test 31 - 0x02 DATAH - configuration byte 2 for the test 32 - 0x03 DELAY - delay in n * 10ms until test is started 29 + .. csv-table:: 30 + :header: "Offset", "Name", "Description" 33 31 34 - Using 'i2cset' from the i2c-tools package, the generic command looks like: 32 + 0x00, CMD, which test to trigger 33 + 0x01, DATAL, configuration byte 1 for the test 34 + 0x02, DATAH, configuration byte 2 for the test 35 + 0x03, DELAY, delay in n * 10ms until test is started 35 36 36 - # i2cset -y <bus_num> <testunit_address> <CMD> <DATAL> <DATAH> <DELAY> i 37 + Using 'i2cset' from the i2c-tools package, the generic command looks like:: 38 + 39 + # i2cset -y <bus_num> <testunit_address> <CMD> <DATAL> <DATAH> <DELAY> i 37 40 38 41 DELAY is a generic parameter which will delay the execution of the test in CMD. 39 42 While a command is running (including the delay), new commands will not be ··· 48 45 Commands 49 46 -------- 50 47 51 - 0x00 NOOP (reserved for future use) 48 + 0x00 NOOP 49 + ~~~~~~~~~ 52 50 53 - 0x01 READ_BYTES (also needs master mode) 54 - DATAL - address to read data from (lower 7 bits, highest bit currently unused) 55 - DATAH - number of bytes to read 51 + Reserved for future use. 56 52 57 - This is useful to test if your bus master driver is handling multi-master 58 - correctly. You can trigger the testunit to read bytes from another device on 59 - the bus. If the bus master under test also wants to access the bus at the same 60 - time, the bus will be busy. Example to read 128 bytes from device 0x50 after 61 - 50ms of delay: 53 + 0x01 READ_BYTES 54 + ~~~~~~~~~~~~~~~ 62 55 63 - # i2cset -y 0 0x30 0x01 0x50 0x80 0x05 i 56 + .. list-table:: 57 + :header-rows: 1 64 58 65 - 0x02 SMBUS_HOST_NOTIFY (also needs master mode) 66 - DATAL - low byte of the status word to send 67 - DATAH - high byte of the status word to send 59 + * - CMD 60 + - DATAL 61 + - DATAH 62 + - DELAY 68 63 69 - This test will send an SMBUS_HOST_NOTIFY message to the host. Note that the 70 - status word is currently ignored in the Linux Kernel. Example to send a 71 - notification after 10ms: 64 + * - 0x01 65 + - address to read data from (lower 7 bits, highest bit currently unused) 66 + - number of bytes to read 67 + - n * 10ms 72 68 73 - # i2cset -y 0 0x30 0x02 0x42 0x64 0x01 i 69 + Also needs master mode. This is useful to test if your bus master driver is 70 + handling multi-master correctly. You can trigger the testunit to read bytes 71 + from another device on the bus. If the bus master under test also wants to 72 + access the bus at the same time, the bus will be busy. Example to read 128 73 + bytes from device 0x50 after 50ms of delay:: 74 74 75 - 0x03 SMBUS_BLOCK_PROC_CALL (partial command) 76 - DATAL - must be '1', i.e. one further byte will be written 77 - DATAH - number of bytes to be sent back 78 - DELAY - not applicable, partial command! 75 + # i2cset -y 0 0x30 0x01 0x50 0x80 0x05 i 79 76 80 - This test will respond to a block process call as defined by the SMBus 81 - specification. The one data byte written specifies how many bytes will be sent 82 - back in the following read transfer. Note that in this read transfer, the 83 - testunit will prefix the length of the bytes to follow. So, if your host bus 84 - driver emulates SMBus calls like the majority does, it needs to support the 85 - I2C_M_RECV_LEN flag of an i2c_msg. This is a good testcase for it. The returned 86 - data consists of the length first, and then of an array of bytes from length-1 87 - to 0. Here is an example which emulates i2c_smbus_block_process_call() using 88 - i2ctransfer (you need i2c-tools v4.2 or later): 77 + 0x02 SMBUS_HOST_NOTIFY 78 + ~~~~~~~~~~~~~~~~~~~~~~ 89 79 90 - # i2ctransfer -y 0 w3@0x30 0x03 0x01 0x10 r? 91 - 0x10 0x0f 0x0e 0x0d 0x0c 0x0b 0x0a 0x09 0x08 0x07 0x06 0x05 0x04 0x03 0x02 0x01 0x00 80 + .. list-table:: 81 + :header-rows: 1 82 + 83 + * - CMD 84 + - DATAL 85 + - DATAH 86 + - DELAY 87 + 88 + * - 0x02 89 + - low byte of the status word to send 90 + - high byte of the status word to send 91 + - n * 10ms 92 + 93 + Also needs master mode. This test will send an SMBUS_HOST_NOTIFY message to the 94 + host. Note that the status word is currently ignored in the Linux Kernel. 95 + Example to send a notification after 10ms:: 96 + 97 + # i2cset -y 0 0x30 0x02 0x42 0x64 0x01 i 98 + 99 + If the host controller supports HostNotify, this message with debug level 100 + should appear (Linux 6.11 and later):: 101 + 102 + Detected HostNotify from address 0x30 103 + 104 + 0x03 SMBUS_BLOCK_PROC_CALL 105 + ~~~~~~~~~~~~~~~~~~~~~~~~~~ 106 + 107 + .. list-table:: 108 + :header-rows: 1 109 + 110 + * - CMD 111 + - DATAL 112 + - DATAH 113 + - DELAY 114 + 115 + * - 0x03 116 + - must be '1', i.e. one further byte will be written 117 + - number of bytes to be sent back 118 + - leave out, partial command! 119 + 120 + Partial command. This test will respond to a block process call as defined by 121 + the SMBus specification. The one data byte written specifies how many bytes 122 + will be sent back in the following read transfer. Note that in this read 123 + transfer, the testunit will prefix the length of the bytes to follow. So, if 124 + your host bus driver emulates SMBus calls like the majority does, it needs to 125 + support the I2C_M_RECV_LEN flag of an i2c_msg. This is a good testcase for it. 126 + The returned data consists of the length first, and then of an array of bytes 127 + from length-1 to 0. Here is an example which emulates 128 + i2c_smbus_block_process_call() using i2ctransfer (you need i2c-tools v4.2 or 129 + later):: 130 + 131 + # i2ctransfer -y 0 w3@0x30 0x03 0x01 0x10 r? 132 + 0x10 0x0f 0x0e 0x0d 0x0c 0x0b 0x0a 0x09 0x08 0x07 0x06 0x05 0x04 0x03 0x02 0x01 0x00
+1 -1
MAINTAINERS
··· 2410 2410 M: Vladimir Zapolskiy <vz@mleia.com> 2411 2411 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2412 2412 S: Maintained 2413 - F: Documentation/devicetree/bindings/i2c/i2c-lpc2k.txt 2413 + F: Documentation/devicetree/bindings/i2c/nxp,lpc1788-i2c.yaml 2414 2414 F: arch/arm/boot/dts/nxp/lpc/lpc43* 2415 2415 F: drivers/i2c/busses/i2c-lpc2k.c 2416 2416 F: drivers/memory/pl172.c
+2 -1
drivers/i2c/busses/Kconfig
··· 159 159 Raptor Lake (PCH) 160 160 Meteor Lake (SOC and PCH) 161 161 Birch Stream (SOC) 162 + Arrow Lake (SOC) 162 163 163 164 This driver can also be built as a module. If so, the module 164 165 will be called i2c-i801. ··· 858 857 859 858 config I2C_MT7621 860 859 tristate "MT7621/MT7628 I2C Controller" 861 - depends on (RALINK && (SOC_MT7620 || SOC_MT7621)) || COMPILE_TEST 860 + depends on (RALINK && (SOC_MT7620 || SOC_MT7621)) || ARCH_AIROHA || COMPILE_TEST 862 861 help 863 862 Say Y here to include support for I2C controller in the 864 863 MediaTek MT7621/MT7628 SoCs.
+1
drivers/i2c/busses/i2c-ali1563.c
··· 438 438 439 439 module_pci_driver(ali1563_pci_driver); 440 440 441 + MODULE_DESCRIPTION("i2c driver for the ALi 1563 Southbridge"); 441 442 MODULE_LICENSE("GPL");
+1 -1
drivers/i2c/busses/i2c-ali15x3.c
··· 39 39 We make sure that the SMB is enabled. We leave the ACPI alone. 40 40 41 41 This driver controls the SMB Host only. 42 - The SMB Slave controller on the M15X3 is not enabled. 42 + The SMB Target controller on the M15X3 is not enabled. 43 43 44 44 This driver does not use interrupts. 45 45 */
+2 -2
drivers/i2c/busses/i2c-altera.c
··· 168 168 /* SDA Hold Time, 300ns */ 169 169 writel(3 * clk_mhz / 10, idev->base + ALTR_I2C_SDA_HOLD); 170 170 171 - /* Mask all master interrupt bits */ 171 + /* Mask all interrupt bits */ 172 172 altr_i2c_int_enable(idev, ALTR_I2C_ALL_IRQ, false); 173 173 } 174 174 ··· 376 376 } 377 377 378 378 static const struct i2c_algorithm altr_i2c_algo = { 379 - .master_xfer = altr_i2c_xfer, 379 + .xfer = altr_i2c_xfer, 380 380 .functionality = altr_i2c_func, 381 381 }; 382 382
+7 -8
drivers/i2c/busses/i2c-au1550.c
··· 81 81 return 0; 82 82 } 83 83 84 - static int wait_master_done(struct i2c_au1550_data *adap) 84 + static int wait_controller_done(struct i2c_au1550_data *adap) 85 85 { 86 86 int i; 87 87 88 - /* Wait for Master Done. */ 89 88 for (i = 0; i < 2 * adap->xfer_timeout; i++) { 90 89 if ((RD(adap, PSC_SMBEVNT) & PSC_SMBEVNT_MD) != 0) 91 90 return 0; ··· 119 120 if (q) 120 121 addr |= PSC_SMBTXRX_STP; 121 122 122 - /* Put byte into fifo, start up master. */ 123 + /* Put byte into fifo, start up controller */ 123 124 WR(adap, PSC_SMBTXRX, addr); 124 125 WR(adap, PSC_SMBPCR, PSC_SMBPCR_MS); 125 126 if (wait_ack(adap)) 126 127 return -EIO; 127 - return (q) ? wait_master_done(adap) : 0; 128 + return (q) ? wait_controller_done(adap) : 0; 128 129 } 129 130 130 131 static int wait_for_rx_byte(struct i2c_au1550_data *adap, unsigned char *out) ··· 174 175 175 176 /* The last byte has to indicate transfer done. */ 176 177 WR(adap, PSC_SMBTXRX, PSC_SMBTXRX_STP); 177 - if (wait_master_done(adap)) 178 + if (wait_controller_done(adap)) 178 179 return -EIO; 179 180 180 181 buf[i] = (unsigned char)(RD(adap, PSC_SMBTXRX) & 0xff); ··· 203 204 data = buf[i]; 204 205 data |= PSC_SMBTXRX_STP; 205 206 WR(adap, PSC_SMBTXRX, data); 206 - if (wait_master_done(adap)) 207 + if (wait_controller_done(adap)) 207 208 return -EIO; 208 209 return 0; 209 210 } ··· 245 246 } 246 247 247 248 static const struct i2c_algorithm au1550_algo = { 248 - .master_xfer = au1550_xfer, 249 - .functionality = au1550_func, 249 + .xfer = au1550_xfer, 250 + .functionality = au1550_func, 250 251 }; 251 252 252 253 static void i2c_au1550_setup(struct i2c_au1550_data *priv)
+6 -7
drivers/i2c/busses/i2c-bcm-kona.c
··· 85 85 #define STD_EXT_CLK_FREQ 13000000UL 86 86 #define HS_EXT_CLK_FREQ 104000000UL 87 87 88 - #define MASTERCODE 0x08 /* Mastercodes are 0000_1xxxb */ 88 + #define CONTROLLER_CODE 0x08 /* Controller codes are 0000_1xxxb */ 89 89 90 90 #define I2C_TIMEOUT 100 /* msecs */ 91 91 ··· 544 544 { 545 545 int rc; 546 546 547 - /* Send mastercode at standard speed */ 548 - rc = bcm_kona_i2c_write_byte(dev, MASTERCODE, 1); 547 + /* Send controller code at standard speed */ 548 + rc = bcm_kona_i2c_write_byte(dev, CONTROLLER_CODE, 1); 549 549 if (rc < 0) { 550 550 pr_err("High speed handshake failed\n"); 551 551 return rc; ··· 587 587 return rc; 588 588 } 589 589 590 - /* Master transfer function */ 591 590 static int bcm_kona_i2c_xfer(struct i2c_adapter *adapter, 592 591 struct i2c_msg msgs[], int num) 593 592 { ··· 636 637 } 637 638 } 638 639 639 - /* Send slave address */ 640 + /* Send target address */ 640 641 if (!(pmsg->flags & I2C_M_NOSTART)) { 641 642 rc = bcm_kona_i2c_do_addr(dev, pmsg); 642 643 if (rc < 0) { ··· 696 697 } 697 698 698 699 static const struct i2c_algorithm bcm_algo = { 699 - .master_xfer = bcm_kona_i2c_xfer, 700 + .xfer = bcm_kona_i2c_xfer, 700 701 .functionality = bcm_kona_i2c_functionality, 701 702 }; 702 703 ··· 721 722 dev->std_cfg = &std_cfg_table[BCM_SPD_1MHZ]; 722 723 break; 723 724 case I2C_MAX_HIGH_SPEED_MODE_FREQ: 724 - /* Send mastercode at 100k */ 725 + /* Send controller code at 100k */ 725 726 dev->std_cfg = &std_cfg_table[BCM_SPD_100K]; 726 727 dev->hs_cfg = &hs_cfg_table[BCM_SPD_3P4MHZ]; 727 728 break;
+5 -5
drivers/i2c/busses/i2c-bcm2835.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * BCM2835 master mode driver 3 + * BCM2835 I2C controller driver 4 4 */ 5 5 6 6 #include <linux/clk.h> ··· 25 25 #define BCM2835_I2C_DEL 0x18 26 26 /* 27 27 * 16-bit field for the number of SCL cycles to wait after rising SCL 28 - * before deciding the slave is not responding. 0 disables the 28 + * before deciding the target is not responding. 0 disables the 29 29 * timeout detection. 30 30 */ 31 31 #define BCM2835_I2C_CLKT 0x1c ··· 223 223 /* 224 224 * Repeated Start Condition (Sr) 225 225 * The BCM2835 ARM Peripherals datasheet mentions a way to trigger a Sr when it 226 - * talks about reading from a slave with 10 bit address. This is achieved by 226 + * talks about reading from a target with 10 bit address. This is achieved by 227 227 * issuing a write, poll the I2CS.TA flag and wait for it to be set, and then 228 228 * issue a read. 229 229 * A comment in https://github.com/raspberrypi/linux/issues/254 shows how the ··· 390 390 } 391 391 392 392 static const struct i2c_algorithm bcm2835_i2c_algo = { 393 - .master_xfer = bcm2835_i2c_xfer, 394 - .functionality = bcm2835_i2c_func, 393 + .xfer = bcm2835_i2c_xfer, 394 + .functionality = bcm2835_i2c_func, 395 395 }; 396 396 397 397 /*
+5 -6
drivers/i2c/busses/i2c-brcmstb.c
··· 67 67 68 68 /* BSC block register map structure to cache fields to be written */ 69 69 struct bsc_regs { 70 - u32 chip_address; /* slave address */ 70 + u32 chip_address; /* target address */ 71 71 u32 data_in[N_DATA_REGS]; /* tx data buffer*/ 72 72 u32 cnt_reg; /* rx/tx data length */ 73 73 u32 ctl_reg; /* control register */ ··· 320 320 return rc; 321 321 } 322 322 323 - /* Actual data transfer through the BSC master */ 323 + /* Actual data transfer through the BSC controller */ 324 324 static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev, 325 325 u8 *buf, unsigned int len, 326 326 struct i2c_msg *pmsg) ··· 441 441 return 0; 442 442 } 443 443 444 - /* Master transfer function */ 445 444 static int brcmstb_i2c_xfer(struct i2c_adapter *adapter, 446 445 struct i2c_msg msgs[], int num) 447 446 { ··· 472 473 473 474 brcmstb_set_i2c_start_stop(dev, cond); 474 475 475 - /* Send slave address */ 476 + /* Send target address */ 476 477 if (!(pmsg->flags & I2C_M_NOSTART)) { 477 478 rc = brcmstb_i2c_do_addr(dev, pmsg); 478 479 if (rc < 0) { ··· 544 545 } 545 546 546 547 static const struct i2c_algorithm brcmstb_i2c_algo = { 547 - .master_xfer = brcmstb_i2c_xfer, 548 - .master_xfer_atomic = brcmstb_i2c_xfer_atomic, 548 + .xfer = brcmstb_i2c_xfer, 549 + .xfer_atomic = brcmstb_i2c_xfer_atomic, 549 550 .functionality = brcmstb_i2c_functionality, 550 551 }; 551 552
+1
drivers/i2c/busses/i2c-ccgx-ucsi.c
··· 27 27 } 28 28 EXPORT_SYMBOL_GPL(i2c_new_ccgx_ucsi); 29 29 30 + MODULE_DESCRIPTION("Instantiate UCSI device for Cypress CCGx Type-C controller"); 30 31 MODULE_LICENSE("GPL");
+4 -4
drivers/i2c/busses/i2c-cht-wc.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 2 /* 3 - * Intel CHT Whiskey Cove PMIC I2C Master driver 3 + * Intel CHT Whiskey Cove PMIC I2C controller driver 4 4 * Copyright (C) 2017 Hans de Goede <hdegoede@redhat.com> 5 5 * 6 6 * Based on various non upstream patches to support the CHT Whiskey Cove PMIC: ··· 106 106 return IRQ_HANDLED; 107 107 } 108 108 109 - static u32 cht_wc_i2c_adap_master_func(struct i2c_adapter *adap) 109 + static u32 cht_wc_i2c_adap_func(struct i2c_adapter *adap) 110 110 { 111 111 /* This i2c adapter only supports SMBUS byte transfers */ 112 112 return I2C_FUNC_SMBUS_BYTE_DATA; ··· 168 168 } 169 169 170 170 static const struct i2c_algorithm cht_wc_i2c_adap_algo = { 171 - .functionality = cht_wc_i2c_adap_master_func, 171 + .functionality = cht_wc_i2c_adap_func, 172 172 .smbus_xfer = cht_wc_i2c_adap_smbus_xfer, 173 173 }; 174 174 ··· 554 554 }; 555 555 module_platform_driver(cht_wc_i2c_adap_driver); 556 556 557 - MODULE_DESCRIPTION("Intel CHT Whiskey Cove PMIC I2C Master driver"); 557 + MODULE_DESCRIPTION("Intel CHT Whiskey Cove PMIC I2C controller driver"); 558 558 MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>"); 559 559 MODULE_LICENSE("GPL");
+5 -5
drivers/i2c/busses/i2c-cp2615.c
··· 60 60 CP2615_CFG_LOCKED = -6, 61 61 /* read_len or write_len out of range */ 62 62 CP2615_INVALID_PARAM = -4, 63 - /* I2C slave did not ACK in time */ 63 + /* I2C target did not ACK in time */ 64 64 CP2615_TIMEOUT, 65 65 /* I2C bus busy */ 66 66 CP2615_BUS_BUSY, 67 - /* I2C bus error (ie. device NAK'd the request) */ 67 + /* I2C bus error (ie. target NAK'd the request) */ 68 68 CP2615_BUS_ERROR, 69 69 CP2615_SUCCESS 70 70 }; ··· 211 211 } 212 212 213 213 static int 214 - cp2615_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) 214 + cp2615_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) 215 215 { 216 216 struct usb_interface *usbif = adap->algo_data; 217 217 int i = 0, ret = 0; ··· 250 250 } 251 251 252 252 static const struct i2c_algorithm cp2615_i2c_algo = { 253 - .master_xfer = cp2615_i2c_master_xfer, 254 - .functionality = cp2615_i2c_func, 253 + .xfer = cp2615_i2c_xfer, 254 + .functionality = cp2615_i2c_func, 255 255 }; 256 256 257 257 /*
+2 -2
drivers/i2c/busses/i2c-cpm.c
··· 402 402 /* -----exported algorithm data: ------------------------------------- */ 403 403 404 404 static const struct i2c_algorithm cpm_i2c_algo = { 405 - .master_xfer = cpm_i2c_xfer, 405 + .xfer = cpm_i2c_xfer, 406 406 .functionality = cpm_i2c_func, 407 407 }; 408 408 ··· 570 570 out_8(&cpm->i2c_reg->i2brg, brg); 571 571 572 572 out_8(&cpm->i2c_reg->i2mod, 0x00); 573 - out_8(&cpm->i2c_reg->i2com, I2COM_MASTER); /* Master mode */ 573 + out_8(&cpm->i2c_reg->i2com, I2COM_MASTER); 574 574 575 575 /* Disable interrupts. */ 576 576 out_8(&cpm->i2c_reg->i2cmr, 0);
+2 -2
drivers/i2c/busses/i2c-cros-ec-tunnel.c
··· 235 235 } 236 236 237 237 static const struct i2c_algorithm ec_i2c_algorithm = { 238 - .master_xfer = ec_i2c_xfer, 239 - .functionality = ec_i2c_functionality, 238 + .xfer = ec_i2c_xfer, 239 + .functionality = ec_i2c_functionality, 240 240 }; 241 241 242 242 static int ec_i2c_probe(struct platform_device *pdev)
+8 -9
drivers/i2c/busses/i2c-davinci.c
··· 263 263 /* compute clock dividers */ 264 264 i2c_davinci_calc_clk_dividers(dev); 265 265 266 - /* Respond at reserved "SMBus Host" slave address" (and zero); 266 + /* Respond at reserved "SMBus Host" target address" (and zero); 267 267 * we seem to have no option to not respond... 268 268 */ 269 269 davinci_i2c_write_reg(dev, DAVINCI_I2C_OAR_REG, DAVINCI_I2C_OWN_ADDRESS); ··· 407 407 } 408 408 409 409 /* 410 - * Low level master read/write transaction. This function is called 411 - * from i2c_davinci_xfer. 410 + * Low level read/write transaction. This function is called from 411 + * i2c_davinci_xfer. 412 412 */ 413 413 static int 414 414 i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) ··· 428 428 if (pdata->bus_delay) 429 429 udelay(pdata->bus_delay); 430 430 431 - /* set the slave address */ 431 + /* set the target address */ 432 432 davinci_i2c_write_reg(dev, DAVINCI_I2C_SAR_REG, msg->addr); 433 433 434 434 dev->buf = msg->buf; ··· 440 440 reinit_completion(&dev->cmd_complete); 441 441 dev->cmd_err = 0; 442 442 443 - /* Take I2C out of reset and configure it as master */ 443 + /* Take I2C out of reset and configure it as controller */ 444 444 flag = DAVINCI_I2C_MDR_IRS | DAVINCI_I2C_MDR_MST; 445 445 446 - /* if the slave address is ten bit address, enable XA bit */ 447 446 if (msg->flags & I2C_M_TEN) 448 447 flag |= DAVINCI_I2C_MDR_XA; 449 448 if (!(msg->flags & I2C_M_RD)) ··· 686 687 break; 687 688 688 689 case DAVINCI_I2C_IVR_AAS: 689 - dev_dbg(dev->dev, "Address as slave interrupt\n"); 690 + dev_dbg(dev->dev, "Address as target interrupt\n"); 690 691 break; 691 692 692 693 default: ··· 743 744 #endif 744 745 745 746 static const struct i2c_algorithm i2c_davinci_algo = { 746 - .master_xfer = i2c_davinci_xfer, 747 - .functionality = i2c_davinci_func, 747 + .xfer = i2c_davinci_xfer, 748 + .functionality = i2c_davinci_func, 748 749 }; 749 750 750 751 static const struct of_device_id davinci_i2c_of_match[] = {
+1 -1
drivers/i2c/busses/i2c-designware-platdrv.c
··· 101 101 BT1_I2C_CTL_GO | BT1_I2C_CTL_WR | (reg & BT1_I2C_CTL_ADDR_MASK)); 102 102 } 103 103 104 - static struct regmap_config bt1_i2c_cfg = { 104 + static const struct regmap_config bt1_i2c_cfg = { 105 105 .reg_bits = 32, 106 106 .val_bits = 32, 107 107 .reg_stride = 4,
+3 -3
drivers/i2c/busses/i2c-digicolor.c
··· 281 281 } 282 282 283 283 static const struct i2c_algorithm dc_i2c_algorithm = { 284 - .master_xfer = dc_i2c_xfer, 285 - .functionality = dc_i2c_func, 284 + .xfer = dc_i2c_xfer, 285 + .functionality = dc_i2c_func, 286 286 }; 287 287 288 288 static int dc_i2c_probe(struct platform_device *pdev) ··· 372 372 module_platform_driver(dc_i2c_driver); 373 373 374 374 MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>"); 375 - MODULE_DESCRIPTION("Conexant Digicolor I2C master driver"); 375 + MODULE_DESCRIPTION("Conexant Digicolor I2C controller driver"); 376 376 MODULE_LICENSE("GPL v2");
+1 -1
drivers/i2c/busses/i2c-diolan-u2c.c
··· 414 414 } 415 415 416 416 static const struct i2c_algorithm diolan_usb_algorithm = { 417 - .master_xfer = diolan_usb_xfer, 417 + .xfer = diolan_usb_xfer, 418 418 .functionality = diolan_usb_func, 419 419 }; 420 420
+2 -2
drivers/i2c/busses/i2c-dln2.c
··· 175 175 } 176 176 177 177 static const struct i2c_algorithm dln2_i2c_usb_algorithm = { 178 - .master_xfer = dln2_i2c_xfer, 178 + .xfer = dln2_i2c_xfer, 179 179 .functionality = dln2_i2c_func, 180 180 }; 181 181 ··· 251 251 module_platform_driver(dln2_i2c_driver); 252 252 253 253 MODULE_AUTHOR("Laurentiu Palcu <laurentiu.palcu@intel.com>"); 254 - MODULE_DESCRIPTION("Driver for the Diolan DLN2 I2C master interface"); 254 + MODULE_DESCRIPTION("Driver for the Diolan DLN2 I2C controller interface"); 255 255 MODULE_LICENSE("GPL v2"); 256 256 MODULE_ALIAS("platform:dln2-i2c");
+28 -28
drivers/i2c/busses/i2c-fsi.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0+ 2 2 /* 3 - * FSI-attached I2C master algorithm 3 + * FSI-attached I2C controller algorithm 4 4 * 5 5 * Copyright 2018 IBM Corporation 6 6 * ··· 145 145 /* choose timeout length from legacy driver; it's well tested */ 146 146 #define I2C_ABORT_TIMEOUT msecs_to_jiffies(100) 147 147 148 - struct fsi_i2c_master { 148 + struct fsi_i2c_ctrl { 149 149 struct fsi_device *fsi; 150 150 u8 fifo_size; 151 151 struct list_head ports; ··· 155 155 struct fsi_i2c_port { 156 156 struct list_head list; 157 157 struct i2c_adapter adapter; 158 - struct fsi_i2c_master *master; 158 + struct fsi_i2c_ctrl *ctrl; 159 159 u16 port; 160 160 u16 xfrd; 161 161 }; ··· 183 183 return fsi_device_write(fsi, reg, &data_be, sizeof(data_be)); 184 184 } 185 185 186 - static int fsi_i2c_dev_init(struct fsi_i2c_master *i2c) 186 + static int fsi_i2c_dev_init(struct fsi_i2c_ctrl *i2c) 187 187 { 188 188 int rc; 189 189 u32 mode = I2C_MODE_ENHANCED, extended_status, watermark; ··· 214 214 static int fsi_i2c_set_port(struct fsi_i2c_port *port) 215 215 { 216 216 int rc; 217 - struct fsi_device *fsi = port->master->fsi; 217 + struct fsi_device *fsi = port->ctrl->fsi; 218 218 u32 mode, dummy = 0; 219 219 220 220 rc = fsi_i2c_read_reg(fsi, I2C_FSI_MODE, &mode); ··· 236 236 static int fsi_i2c_start(struct fsi_i2c_port *port, struct i2c_msg *msg, 237 237 bool stop) 238 238 { 239 - struct fsi_i2c_master *i2c = port->master; 239 + struct fsi_i2c_ctrl *i2c = port->ctrl; 240 240 u32 cmd = I2C_CMD_WITH_START | I2C_CMD_WITH_ADDR; 241 241 242 242 port->xfrd = 0; ··· 268 268 { 269 269 int write; 270 270 int rc; 271 - struct fsi_i2c_master *i2c = port->master; 271 + struct fsi_i2c_ctrl *i2c = port->ctrl; 272 272 int bytes_to_write = i2c->fifo_size - fifo_count; 273 273 int bytes_remaining = msg->len - port->xfrd; 274 274 ··· 294 294 { 295 295 int read; 296 296 int rc; 297 - struct fsi_i2c_master *i2c = port->master; 297 + struct fsi_i2c_ctrl *i2c = port->ctrl; 298 298 int bytes_to_read; 299 299 int xfr_remaining = msg->len - port->xfrd; 300 300 u32 dummy; ··· 330 330 { 331 331 u32 stat = 0; 332 332 struct fsi_i2c_port *port = adap->algo_data; 333 - struct fsi_i2c_master *i2c = port->master; 333 + struct fsi_i2c_ctrl *i2c = port->ctrl; 334 334 335 335 fsi_i2c_read_reg(i2c->fsi, I2C_FSI_STAT, &stat); 336 336 ··· 341 341 { 342 342 u32 dummy = 0; 343 343 struct fsi_i2c_port *port = adap->algo_data; 344 - struct fsi_i2c_master *i2c = port->master; 344 + struct fsi_i2c_ctrl *i2c = port->ctrl; 345 345 346 346 if (val) 347 347 fsi_i2c_write_reg(i2c->fsi, I2C_FSI_SET_SCL, &dummy); ··· 353 353 { 354 354 u32 stat = 0; 355 355 struct fsi_i2c_port *port = adap->algo_data; 356 - struct fsi_i2c_master *i2c = port->master; 356 + struct fsi_i2c_ctrl *i2c = port->ctrl; 357 357 358 358 fsi_i2c_read_reg(i2c->fsi, I2C_FSI_STAT, &stat); 359 359 ··· 364 364 { 365 365 u32 dummy = 0; 366 366 struct fsi_i2c_port *port = adap->algo_data; 367 - struct fsi_i2c_master *i2c = port->master; 367 + struct fsi_i2c_ctrl *i2c = port->ctrl; 368 368 369 369 if (val) 370 370 fsi_i2c_write_reg(i2c->fsi, I2C_FSI_SET_SDA, &dummy); ··· 377 377 int rc; 378 378 u32 mode; 379 379 struct fsi_i2c_port *port = adap->algo_data; 380 - struct fsi_i2c_master *i2c = port->master; 380 + struct fsi_i2c_ctrl *i2c = port->ctrl; 381 381 382 382 rc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_MODE, &mode); 383 383 if (rc) ··· 392 392 int rc; 393 393 u32 mode; 394 394 struct fsi_i2c_port *port = adap->algo_data; 395 - struct fsi_i2c_master *i2c = port->master; 395 + struct fsi_i2c_ctrl *i2c = port->ctrl; 396 396 397 397 rc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_MODE, &mode); 398 398 if (rc) ··· 402 402 fsi_i2c_write_reg(i2c->fsi, I2C_FSI_MODE, &mode); 403 403 } 404 404 405 - static int fsi_i2c_reset_bus(struct fsi_i2c_master *i2c, 405 + static int fsi_i2c_reset_bus(struct fsi_i2c_ctrl *i2c, 406 406 struct fsi_i2c_port *port) 407 407 { 408 408 int rc; ··· 435 435 return fsi_i2c_dev_init(i2c); 436 436 } 437 437 438 - static int fsi_i2c_reset_engine(struct fsi_i2c_master *i2c, u16 port) 438 + static int fsi_i2c_reset_engine(struct fsi_i2c_ctrl *i2c, u16 port) 439 439 { 440 440 int rc; 441 441 u32 mode, dummy = 0; ··· 478 478 unsigned long start; 479 479 u32 cmd = I2C_CMD_WITH_STOP; 480 480 u32 stat; 481 - struct fsi_i2c_master *i2c = port->master; 481 + struct fsi_i2c_ctrl *i2c = port->ctrl; 482 482 struct fsi_device *fsi = i2c->fsi; 483 483 484 484 rc = fsi_i2c_reset_engine(i2c, port->port); ··· 505 505 if (rc) 506 506 return rc; 507 507 508 - /* wait until we see command complete in the master */ 508 + /* wait until we see command complete in the controller */ 509 509 start = jiffies; 510 510 511 511 do { ··· 579 579 unsigned long start = jiffies; 580 580 581 581 do { 582 - rc = fsi_i2c_read_reg(port->master->fsi, I2C_FSI_STAT, 582 + rc = fsi_i2c_read_reg(port->ctrl->fsi, I2C_FSI_STAT, 583 583 &status); 584 584 if (rc) 585 585 return rc; ··· 609 609 int i, rc; 610 610 unsigned long start_time; 611 611 struct fsi_i2c_port *port = adap->algo_data; 612 - struct fsi_i2c_master *master = port->master; 612 + struct fsi_i2c_ctrl *ctrl = port->ctrl; 613 613 struct i2c_msg *msg; 614 614 615 - mutex_lock(&master->lock); 615 + mutex_lock(&ctrl->lock); 616 616 617 617 rc = fsi_i2c_set_port(port); 618 618 if (rc) ··· 633 633 } 634 634 635 635 unlock: 636 - mutex_unlock(&master->lock); 636 + mutex_unlock(&ctrl->lock); 637 637 return rc ? : num; 638 638 } 639 639 ··· 654 654 }; 655 655 656 656 static const struct i2c_algorithm fsi_i2c_algorithm = { 657 - .master_xfer = fsi_i2c_xfer, 657 + .xfer = fsi_i2c_xfer, 658 658 .functionality = fsi_i2c_functionality, 659 659 }; 660 660 ··· 676 676 677 677 static int fsi_i2c_probe(struct device *dev) 678 678 { 679 - struct fsi_i2c_master *i2c; 679 + struct fsi_i2c_ctrl *i2c; 680 680 struct fsi_i2c_port *port; 681 681 struct device_node *np; 682 682 u32 port_no, ports, stat; ··· 699 699 return rc; 700 700 701 701 ports = FIELD_GET(I2C_STAT_MAX_PORT, stat) + 1; 702 - dev_dbg(dev, "I2C master has %d ports\n", ports); 702 + dev_dbg(dev, "I2C controller has %d ports\n", ports); 703 703 704 704 for (port_no = 0; port_no < ports; port_no++) { 705 705 np = fsi_i2c_find_port_of_node(dev->of_node, port_no); ··· 712 712 break; 713 713 } 714 714 715 - port->master = i2c; 715 + port->ctrl = i2c; 716 716 port->port = port_no; 717 717 718 718 port->adapter.owner = THIS_MODULE; ··· 742 742 743 743 static int fsi_i2c_remove(struct device *dev) 744 744 { 745 - struct fsi_i2c_master *i2c = dev_get_drvdata(dev); 745 + struct fsi_i2c_ctrl *i2c = dev_get_drvdata(dev); 746 746 struct fsi_i2c_port *port, *tmp; 747 747 748 748 list_for_each_entry_safe(port, tmp, &i2c->ports, list) { ··· 772 772 module_fsi_driver(fsi_i2c_driver); 773 773 774 774 MODULE_AUTHOR("Eddie James <eajames@us.ibm.com>"); 775 - MODULE_DESCRIPTION("FSI attached I2C master"); 775 + MODULE_DESCRIPTION("FSI attached I2C controller"); 776 776 MODULE_LICENSE("GPL");
+4 -4
drivers/i2c/busses/i2c-gpio.c
··· 216 216 217 217 priv->scl_irq_data = duration; 218 218 /* 219 - * Interrupt on falling SCL. This ensures that the master under test has 220 - * really started the transfer. Interrupt on falling SDA did only 219 + * Interrupt on falling SCL. This ensures that the controller under test 220 + * has really started the transfer. Interrupt on falling SDA did only 221 221 * exercise 'bus busy' detection on some HW but not 'arbitration lost'. 222 222 * Note that the interrupt latency may cause the first bits to be 223 223 * transmitted correctly. ··· 245 245 246 246 priv->scl_irq_data = duration; 247 247 /* 248 - * Interrupt on falling SCL. This ensures that the master under test has 249 - * really started the transfer. 248 + * Interrupt on falling SCL. This ensures that the controller under test 249 + * has really started the transfer. 250 250 */ 251 251 return i2c_gpio_fi_act_on_scl_irq(priv, inject_panic_irq); 252 252 }
+1 -1
drivers/i2c/busses/i2c-highlander.c
··· 331 331 /* Ensure we're in a sane state */ 332 332 highlander_i2c_done(dev); 333 333 334 - /* Set slave address */ 334 + /* Set target address */ 335 335 iowrite16((addr << 1) | read_write, dev->base + SMSMADR); 336 336 337 337 highlander_i2c_command(dev, command, dev->buf_len);
+4 -4
drivers/i2c/busses/i2c-hisi.c
··· 197 197 * wait for the transfer done. The major transfer process is performed 198 198 * in the IRQ handler. 199 199 */ 200 - static int hisi_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, 201 - int num) 200 + static int hisi_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, 201 + int num) 202 202 { 203 203 struct hisi_i2c_controller *ctlr = i2c_get_adapdata(adap); 204 204 DECLARE_COMPLETION_ONSTACK(done); ··· 236 236 } 237 237 238 238 static const struct i2c_algorithm hisi_i2c_algo = { 239 - .master_xfer = hisi_i2c_master_xfer, 240 - .functionality = hisi_i2c_functionality, 239 + .xfer = hisi_i2c_xfer, 240 + .functionality = hisi_i2c_functionality, 241 241 }; 242 242 243 243 static int hisi_i2c_read_rx_fifo(struct hisi_i2c_controller *ctlr)
+3 -3
drivers/i2c/busses/i2c-hix5hd2.c
··· 200 200 /* the last byte don't need send ACK */ 201 201 writel_relaxed(I2C_READ | I2C_NO_ACK, priv->regs + HIX5I2C_COM); 202 202 } else if (priv->msg_len > 1) { 203 - /* if i2c master receive data will send ACK */ 203 + /* if i2c controller receive data will send ACK */ 204 204 writel_relaxed(I2C_READ, priv->regs + HIX5I2C_COM); 205 205 } else { 206 206 hix5hd2_rw_handle_stop(priv); ··· 384 384 } 385 385 386 386 static const struct i2c_algorithm hix5hd2_i2c_algorithm = { 387 - .master_xfer = hix5hd2_i2c_xfer, 388 - .functionality = hix5hd2_i2c_func, 387 + .xfer = hix5hd2_i2c_xfer, 388 + .functionality = hix5hd2_i2c_func, 389 389 }; 390 390 391 391 static int hix5hd2_i2c_probe(struct platform_device *pdev)
+9 -6
drivers/i2c/busses/i2c-i801.c
··· 80 80 * Meteor Lake SoC-S (SOC) 0xae22 32 hard yes yes yes 81 81 * Meteor Lake PCH-S (PCH) 0x7f23 32 hard yes yes yes 82 82 * Birch Stream (SOC) 0x5796 32 hard yes yes yes 83 + * Arrow Lake-H (SOC) 0x7722 32 hard yes yes yes 83 84 * 84 85 * Features supported by this driver: 85 86 * Software PEC no ··· 88 87 * Block buffer yes 89 88 * Block process call transaction yes 90 89 * I2C block read transaction yes (doesn't use the block buffer) 91 - * Slave mode no 90 + * Target mode no 92 91 * SMBus Host Notify yes 93 92 * Interrupt processing yes 94 93 * ··· 238 237 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_M_SMBUS 0x54a3 239 238 #define PCI_DEVICE_ID_INTEL_BIRCH_STREAM_SMBUS 0x5796 240 239 #define PCI_DEVICE_ID_INTEL_BROXTON_SMBUS 0x5ad4 240 + #define PCI_DEVICE_ID_INTEL_ARROW_LAKE_H_SMBUS 0x7722 241 241 #define PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_S_SMBUS 0x7a23 242 242 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_S_SMBUS 0x7aa3 243 243 #define PCI_DEVICE_ID_INTEL_METEOR_LAKE_P_SMBUS 0x7e22 ··· 1054 1052 { PCI_DEVICE_DATA(INTEL, METEOR_LAKE_SOC_S_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, 1055 1053 { PCI_DEVICE_DATA(INTEL, METEOR_LAKE_PCH_S_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, 1056 1054 { PCI_DEVICE_DATA(INTEL, BIRCH_STREAM_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, 1055 + { PCI_DEVICE_DATA(INTEL, ARROW_LAKE_H_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, 1057 1056 { 0, } 1058 1057 }; 1059 1058 ··· 1277 1274 i2c_new_client_device(&priv->adapter, &info); 1278 1275 } 1279 1276 1280 - /* Register optional slaves */ 1281 - static void i801_probe_optional_slaves(struct i801_priv *priv) 1277 + /* Register optional targets */ 1278 + static void i801_probe_optional_targets(struct i801_priv *priv) 1282 1279 { 1283 - /* Only register slaves on main SMBus channel */ 1280 + /* Only register targets on main SMBus channel */ 1284 1281 if (priv->features & FEATURE_IDF) 1285 1282 return; 1286 1283 ··· 1307 1304 } 1308 1305 #else 1309 1306 static void __init input_apanel_init(void) {} 1310 - static void i801_probe_optional_slaves(struct i801_priv *priv) {} 1307 + static void i801_probe_optional_targets(struct i801_priv *priv) {} 1311 1308 #endif /* CONFIG_X86 && CONFIG_DMI */ 1312 1309 1313 1310 #ifdef CONFIG_I2C_I801_MUX ··· 1777 1774 1778 1775 /* We ignore errors - multiplexing is optional */ 1779 1776 i801_add_mux(priv); 1780 - i801_probe_optional_slaves(priv); 1777 + i801_probe_optional_targets(priv); 1781 1778 1782 1779 pci_set_drvdata(dev, priv); 1783 1780
+11 -16
drivers/i2c/busses/i2c-ibm_iic.c
··· 136 136 137 137 DBG("%d: init\n", dev->idx); 138 138 139 - /* Clear master address */ 139 + /* Clear remote target address */ 140 140 out_8(&iic->lmadr, 0); 141 141 out_8(&iic->hmadr, 0); 142 142 143 - /* Clear slave address */ 143 + /* Clear local target address */ 144 144 out_8(&iic->lsadr, 0); 145 145 out_8(&iic->hsadr, 0); 146 146 ··· 337 337 } 338 338 339 339 /* 340 - * Get master transfer result and clear errors if any. 340 + * Get controller transfer result and clear errors if any. 341 341 * Returns the number of actually transferred bytes or error (<0) 342 342 */ 343 343 static int iic_xfer_result(struct ibm_iic_private* dev) ··· 352 352 out_8(&iic->extsts, EXTSTS_IRQP | EXTSTS_IRQD | 353 353 EXTSTS_LA | EXTSTS_ICT | EXTSTS_XFRA); 354 354 355 - /* Flush master data buffer */ 355 + /* Flush controller data buffer */ 356 356 out_8(&iic->mdcntl, in_8(&iic->mdcntl) | MDCNTL_FMDB); 357 357 358 358 /* Is bus free? ··· 401 401 } 402 402 403 403 /* 404 - * Wait for master transfer to complete. 404 + * Wait for controller transfer to complete. 405 405 * It puts current process to sleep until we get interrupt or timeout expires. 406 406 * Returns the number of transferred bytes or error (<0) 407 407 */ ··· 452 452 return ret; 453 453 } 454 454 455 - /* 456 - * Low level master transfer routine 457 - */ 458 455 static int iic_xfer_bytes(struct ibm_iic_private* dev, struct i2c_msg* pm, 459 456 int combined_xfer) 460 457 { ··· 508 511 return ret > 0 ? 0 : ret; 509 512 } 510 513 511 - /* 512 - * Set target slave address for master transfer 513 - */ 514 + /* Set remote target address for transfer */ 514 515 static inline void iic_address(struct ibm_iic_private* dev, struct i2c_msg* msg) 515 516 { 516 517 volatile struct iic_regs __iomem *iic = dev->vaddr; ··· 541 546 } 542 547 543 548 /* 544 - * Generic master transfer entrypoint. 549 + * Generic transfer entrypoint. 545 550 * Returns the number of processed messages or error (<0) 546 551 */ 547 552 static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) ··· 599 604 } 600 605 } 601 606 else { 602 - /* Flush master data buffer (just in case) */ 607 + /* Flush controller data buffer (just in case) */ 603 608 out_8(&iic->mdcntl, in_8(&iic->mdcntl) | MDCNTL_FMDB); 604 609 } 605 610 606 - /* Load slave address */ 611 + /* Load target address */ 607 612 iic_address(dev, &msgs[0]); 608 613 609 614 /* Do real transfer */ ··· 619 624 } 620 625 621 626 static const struct i2c_algorithm iic_algo = { 622 - .master_xfer = iic_xfer, 623 - .functionality = iic_func 627 + .xfer = iic_xfer, 628 + .functionality = iic_func 624 629 }; 625 630 626 631 /*
+6 -9
drivers/i2c/busses/i2c-iop3xx.c
··· 22 22 * - Make it work with IXP46x chips 23 23 * - Cleanup function names, coding style, etc 24 24 * 25 - * - writing to slave address causes latchup on iop331. 25 + * - writing to local target address causes latchup on iop331. 26 26 * fix: driver refuses to address self. 27 27 */ 28 28 ··· 234 234 int status; 235 235 int rc; 236 236 237 - /* avoid writing to my slave address (hangs on 80331), 237 + /* avoid writing to local target address (hangs on 80331), 238 238 * forbidden in Intel developer manual 239 239 */ 240 240 if (msg->addr == MYSAR) { ··· 349 349 } 350 350 } 351 351 352 - /* 353 - * master_xfer() - main read/write entry 354 - */ 355 352 static int 356 - iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, 357 - int num) 353 + iop3xx_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, 354 + int num) 358 355 { 359 356 struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; 360 357 int im = 0; ··· 381 384 } 382 385 383 386 static const struct i2c_algorithm iop3xx_i2c_algo = { 384 - .master_xfer = iop3xx_i2c_master_xfer, 385 - .functionality = iop3xx_i2c_func, 387 + .xfer = iop3xx_i2c_xfer, 388 + .functionality = iop3xx_i2c_func, 386 389 }; 387 390 388 391 static void
+1 -1
drivers/i2c/busses/i2c-isch.c
··· 104 104 result = -EIO; 105 105 dev_dbg(&sch_adapter.dev, "Bus collision! SMBus may be " 106 106 "locked until next hard reset. (sorry!)\n"); 107 - /* Clock stops and slave is stuck in mid-transmission */ 107 + /* Clock stops and target is stuck in mid-transmission */ 108 108 } else if (temp & 0x02) { 109 109 result = -EIO; 110 110 dev_err(&sch_adapter.dev, "Error: no response!\n");
+2 -2
drivers/i2c/busses/i2c-jz4780.c
··· 730 730 } 731 731 732 732 static const struct i2c_algorithm jz4780_i2c_algorithm = { 733 - .master_xfer = jz4780_i2c_xfer, 734 - .functionality = jz4780_i2c_functionality, 733 + .xfer = jz4780_i2c_xfer, 734 + .functionality = jz4780_i2c_functionality, 735 735 }; 736 736 737 737 static const struct ingenic_i2c_config jz4780_i2c_config = {
+2 -2
drivers/i2c/busses/i2c-kempld.c
··· 276 276 } 277 277 278 278 static const struct i2c_algorithm kempld_i2c_algorithm = { 279 - .master_xfer = kempld_i2c_xfer, 280 - .functionality = kempld_i2c_func, 279 + .xfer = kempld_i2c_xfer, 280 + .functionality = kempld_i2c_func, 281 281 }; 282 282 283 283 static const struct i2c_adapter kempld_i2c_adapter = {
+10 -10
drivers/i2c/busses/i2c-ljca.c
··· 76 76 return ret < 0 ? ret : 0; 77 77 } 78 78 79 - static int ljca_i2c_start(struct ljca_i2c_dev *ljca_i2c, u8 slave_addr, 79 + static int ljca_i2c_start(struct ljca_i2c_dev *ljca_i2c, u8 target_addr, 80 80 enum ljca_xfer_type type) 81 81 { 82 82 struct ljca_i2c_rw_packet *w_packet = ··· 88 88 89 89 w_packet->id = ljca_i2c->i2c_info->id; 90 90 w_packet->len = cpu_to_le16(sizeof(*w_packet->data)); 91 - w_packet->data[0] = (slave_addr << 1) | type; 91 + w_packet->data[0] = (target_addr << 1) | type; 92 92 93 93 ret = ljca_transfer(ljca_i2c->ljca, LJCA_I2C_START, (u8 *)w_packet, 94 94 struct_size(w_packet, data, 1), (u8 *)r_packet, ··· 107 107 return 0; 108 108 } 109 109 110 - static void ljca_i2c_stop(struct ljca_i2c_dev *ljca_i2c, u8 slave_addr) 110 + static void ljca_i2c_stop(struct ljca_i2c_dev *ljca_i2c, u8 target_addr) 111 111 { 112 112 struct ljca_i2c_rw_packet *w_packet = 113 113 (struct ljca_i2c_rw_packet *)ljca_i2c->obuf; ··· 169 169 return 0; 170 170 } 171 171 172 - static int ljca_i2c_read(struct ljca_i2c_dev *ljca_i2c, u8 slave_addr, u8 *data, 172 + static int ljca_i2c_read(struct ljca_i2c_dev *ljca_i2c, u8 target_addr, u8 *data, 173 173 u8 len) 174 174 { 175 175 int ret; 176 176 177 - ret = ljca_i2c_start(ljca_i2c, slave_addr, LJCA_I2C_READ_XFER_TYPE); 177 + ret = ljca_i2c_start(ljca_i2c, target_addr, LJCA_I2C_READ_XFER_TYPE); 178 178 if (!ret) 179 179 ret = ljca_i2c_pure_read(ljca_i2c, data, len); 180 180 181 - ljca_i2c_stop(ljca_i2c, slave_addr); 181 + ljca_i2c_stop(ljca_i2c, target_addr); 182 182 183 183 return ret; 184 184 } ··· 213 213 return 0; 214 214 } 215 215 216 - static int ljca_i2c_write(struct ljca_i2c_dev *ljca_i2c, u8 slave_addr, 216 + static int ljca_i2c_write(struct ljca_i2c_dev *ljca_i2c, u8 target_addr, 217 217 u8 *data, u8 len) 218 218 { 219 219 int ret; 220 220 221 - ret = ljca_i2c_start(ljca_i2c, slave_addr, LJCA_I2C_WRITE_XFER_TYPE); 221 + ret = ljca_i2c_start(ljca_i2c, target_addr, LJCA_I2C_WRITE_XFER_TYPE); 222 222 if (!ret) 223 223 ret = ljca_i2c_pure_write(ljca_i2c, data, len); 224 224 225 - ljca_i2c_stop(ljca_i2c, slave_addr); 225 + ljca_i2c_stop(ljca_i2c, target_addr); 226 226 227 227 return ret; 228 228 } ··· 266 266 }; 267 267 268 268 static const struct i2c_algorithm ljca_i2c_algo = { 269 - .master_xfer = ljca_i2c_xfer, 269 + .xfer = ljca_i2c_xfer, 270 270 .functionality = ljca_i2c_func, 271 271 }; 272 272
+5 -5
drivers/i2c/busses/i2c-lpc2k.c
··· 50 50 51 51 /* 52 52 * 26 possible I2C status codes, but codes applicable only 53 - * to master are listed here and used in this driver 53 + * to controller mode are listed here and used in this driver 54 54 */ 55 55 enum { 56 56 M_BUS_ERROR = 0x00, ··· 157 157 break; 158 158 159 159 case MR_ADDR_R_ACK: 160 - /* Receive first byte from slave */ 160 + /* Receive first byte from target */ 161 161 if (i2c->msg->len == 1) { 162 162 /* Last byte, return NACK */ 163 163 writel(LPC24XX_AA, i2c->base + LPC24XX_I2CONCLR); ··· 196 196 } 197 197 198 198 /* 199 - * One pre-last data input, send NACK to tell the slave that 199 + * One pre-last data input, send NACK to tell the target that 200 200 * this is going to be the last data byte to be transferred. 201 201 */ 202 202 if (i2c->msg_idx >= i2c->msg->len - 2) { ··· 338 338 } 339 339 340 340 static const struct i2c_algorithm i2c_lpc2k_algorithm = { 341 - .master_xfer = i2c_lpc2k_xfer, 342 - .functionality = i2c_lpc2k_functionality, 341 + .xfer = i2c_lpc2k_xfer, 342 + .functionality = i2c_lpc2k_functionality, 343 343 }; 344 344 345 345 static int i2c_lpc2k_probe(struct platform_device *pdev)
+5 -6
drivers/i2c/busses/i2c-ls2x.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 - * Loongson-2K/Loongson LS7A I2C master mode driver 3 + * Loongson-2K/Loongson LS7A I2C controller mode driver 4 4 * 5 5 * Copyright (C) 2013 Loongson Technology Corporation Limited. 6 6 * Copyright (C) 2014-2017 Lemote, Inc. ··· 51 51 /* Control Register Bit */ 52 52 #define LS2X_CTR_EN BIT(7) /* 0: I2c frequency setting 1: Normal */ 53 53 #define LS2X_CTR_IEN BIT(6) /* Enable i2c interrupt */ 54 - #define LS2X_CTR_MST BIT(5) /* 0: Slave mode 1: Master mode */ 54 + #define LS2X_CTR_MST BIT(5) /* 0: Target mode 1: Controller mode */ 55 55 #define CTR_FREQ_MASK GENMASK(7, 6) 56 56 #define CTR_READY_MASK GENMASK(7, 5) 57 57 ··· 251 251 return ret; 252 252 } 253 253 254 - static int ls2x_i2c_master_xfer(struct i2c_adapter *adap, 255 - struct i2c_msg *msgs, int num) 254 + static int ls2x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) 256 255 { 257 256 int ret; 258 257 struct i2c_msg *msg, *emsg = msgs + num; ··· 272 273 } 273 274 274 275 static const struct i2c_algorithm ls2x_i2c_algo = { 275 - .master_xfer = ls2x_i2c_master_xfer, 276 - .functionality = ls2x_i2c_func, 276 + .xfer = ls2x_i2c_xfer, 277 + .functionality = ls2x_i2c_func, 277 278 }; 278 279 279 280 static int ls2x_i2c_probe(struct platform_device *pdev)
+7 -7
drivers/i2c/busses/i2c-mlxcpld.c
··· 197 197 if (val & MLXCPLD_LPCI2C_TRANS_END) { 198 198 if (val & MLXCPLD_LPCI2C_STATUS_NACK) 199 199 /* 200 - * The slave is unable to accept the data. No such 201 - * slave, command not understood, or unable to accept 200 + * The target is unable to accept the data. No such 201 + * target, command not understood, or unable to accept 202 202 * any more data. 203 203 */ 204 204 *status = MLXCPLD_LPCI2C_NACK_IND; ··· 280 280 } 281 281 282 282 /* 283 - * Wait for master transfer to complete. 283 + * Wait for transfer to complete. 284 284 * It puts current process to sleep until we get interrupt or timeout expires. 285 285 * Returns the number of transferred or read bytes or error (<0). 286 286 */ ··· 315 315 /* 316 316 * Actual read data len will be always the same as 317 317 * requested len. 0xff (line pull-up) will be returned 318 - * if slave has no data to return. Thus don't read 318 + * if target has no data to return. Thus don't read 319 319 * MLXCPLD_LPCI2C_NUM_DAT_REG reg from CPLD. Only in case of 320 320 * SMBus block read transaction data len can be different, 321 321 * check this case. ··· 375 375 } 376 376 377 377 /* 378 - * Set target slave address with command for master transfer. 378 + * Set target address with command for transfer. 379 379 * It should be latest executed function before CPLD transaction. 380 380 */ 381 381 cmd = (priv->xfer.msg[0].addr << 1) | priv->xfer.cmd; ··· 449 449 } 450 450 451 451 static const struct i2c_algorithm mlxcpld_i2c_algo = { 452 - .master_xfer = mlxcpld_i2c_xfer, 453 - .functionality = mlxcpld_i2c_func 452 + .xfer = mlxcpld_i2c_xfer, 453 + .functionality = mlxcpld_i2c_func 454 454 }; 455 455 456 456 static const struct i2c_adapter_quirks mlxcpld_i2c_quirks = {
+2 -2
drivers/i2c/busses/i2c-mpc.c
··· 115 115 writeb(x, i2c->base + MPC_I2C_CR); 116 116 } 117 117 118 - /* Sometimes 9th clock pulse isn't generated, and slave doesn't release 118 + /* Sometimes 9th clock pulse isn't generated, and target doesn't release 119 119 * the bus, because it wants to send ACK. 120 120 * Following sequence of enabling/disabling and sending start/stop generates 121 121 * the 9 pulses, each with a START then ending with STOP, so it's all OK. ··· 759 759 } 760 760 761 761 static const struct i2c_algorithm mpc_algo = { 762 - .master_xfer = mpc_xfer, 762 + .xfer = mpc_xfer, 763 763 .functionality = mpc_functionality, 764 764 }; 765 765
+13 -13
drivers/i2c/busses/i2c-mt7621.c
··· 117 117 return ((ack & ack_expected) == ack_expected) ? 0 : -ENXIO; 118 118 } 119 119 120 - static int mtk_i2c_master_start(struct mtk_i2c *i2c) 120 + static int mtk_i2c_start(struct mtk_i2c *i2c) 121 121 { 122 122 iowrite32(SM0CTL1_START | SM0CTL1_TRI, i2c->base + REG_SM0CTL1_REG); 123 123 return mtk_i2c_wait_idle(i2c); 124 124 } 125 125 126 - static int mtk_i2c_master_stop(struct mtk_i2c *i2c) 126 + static int mtk_i2c_stop(struct mtk_i2c *i2c) 127 127 { 128 128 iowrite32(SM0CTL1_STOP | SM0CTL1_TRI, i2c->base + REG_SM0CTL1_REG); 129 129 return mtk_i2c_wait_idle(i2c); 130 130 } 131 131 132 - static int mtk_i2c_master_cmd(struct mtk_i2c *i2c, u32 cmd, int page_len) 132 + static int mtk_i2c_cmd(struct mtk_i2c *i2c, u32 cmd, int page_len) 133 133 { 134 134 iowrite32(cmd | SM0CTL1_TRI | SM0CTL1_PGLEN(page_len), 135 135 i2c->base + REG_SM0CTL1_REG); 136 136 return mtk_i2c_wait_idle(i2c); 137 137 } 138 138 139 - static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, 140 - int num) 139 + static int mtk_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, 140 + int num) 141 141 { 142 142 struct mtk_i2c *i2c; 143 143 struct i2c_msg *pmsg; ··· 157 157 goto err_timeout; 158 158 159 159 /* start sequence */ 160 - ret = mtk_i2c_master_start(i2c); 160 + ret = mtk_i2c_start(i2c); 161 161 if (ret) 162 162 goto err_timeout; 163 163 ··· 169 169 if (pmsg->flags & I2C_M_RD) 170 170 addr |= 1; 171 171 iowrite32(addr, i2c->base + REG_SM0D0_REG); 172 - ret = mtk_i2c_master_cmd(i2c, SM0CTL1_WRITE, 2); 172 + ret = mtk_i2c_cmd(i2c, SM0CTL1_WRITE, 2); 173 173 if (ret) 174 174 goto err_timeout; 175 175 } else { 176 176 /* 7 bits address */ 177 177 addr = i2c_8bit_addr_from_msg(pmsg); 178 178 iowrite32(addr, i2c->base + REG_SM0D0_REG); 179 - ret = mtk_i2c_master_cmd(i2c, SM0CTL1_WRITE, 1); 179 + ret = mtk_i2c_cmd(i2c, SM0CTL1_WRITE, 1); 180 180 if (ret) 181 181 goto err_timeout; 182 182 } ··· 202 202 cmd = SM0CTL1_WRITE; 203 203 } 204 204 205 - ret = mtk_i2c_master_cmd(i2c, cmd, page_len); 205 + ret = mtk_i2c_cmd(i2c, cmd, page_len); 206 206 if (ret) 207 207 goto err_timeout; 208 208 ··· 222 222 } 223 223 } 224 224 225 - ret = mtk_i2c_master_stop(i2c); 225 + ret = mtk_i2c_stop(i2c); 226 226 if (ret) 227 227 goto err_timeout; 228 228 ··· 230 230 return i; 231 231 232 232 err_ack: 233 - ret = mtk_i2c_master_stop(i2c); 233 + ret = mtk_i2c_stop(i2c); 234 234 if (ret) 235 235 goto err_timeout; 236 236 return -ENXIO; ··· 247 247 } 248 248 249 249 static const struct i2c_algorithm mtk_i2c_algo = { 250 - .master_xfer = mtk_i2c_master_xfer, 251 - .functionality = mtk_i2c_func, 250 + .xfer = mtk_i2c_xfer, 251 + .functionality = mtk_i2c_func, 252 252 }; 253 253 254 254 static const struct of_device_id i2c_mtk_dt_ids[] = {
+6 -6
drivers/i2c/busses/i2c-mv64xxx.c
··· 89 89 MV64XXX_I2C_STATE_WAITING_FOR_RESTART, 90 90 MV64XXX_I2C_STATE_WAITING_FOR_ADDR_1_ACK, 91 91 MV64XXX_I2C_STATE_WAITING_FOR_ADDR_2_ACK, 92 - MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK, 93 - MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA, 92 + MV64XXX_I2C_STATE_WAITING_FOR_TARGET_ACK, 93 + MV64XXX_I2C_STATE_WAITING_FOR_TARGET_DATA, 94 94 }; 95 95 96 96 /* Driver actions */ ··· 279 279 } else { 280 280 drv_data->action = MV64XXX_I2C_ACTION_SEND_DATA; 281 281 drv_data->state = 282 - MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK; 282 + MV64XXX_I2C_STATE_WAITING_FOR_TARGET_ACK; 283 283 drv_data->bytes_left--; 284 284 } 285 285 break; ··· 307 307 drv_data->action = MV64XXX_I2C_ACTION_RCV_DATA; 308 308 drv_data->bytes_left--; 309 309 } 310 - drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA; 310 + drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_TARGET_DATA; 311 311 312 312 if ((drv_data->bytes_left == 1) || drv_data->aborting) 313 313 drv_data->cntl_bits &= ~MV64XXX_I2C_REG_CONTROL_ACK; ··· 797 797 } 798 798 799 799 static const struct i2c_algorithm mv64xxx_i2c_algo = { 800 - .master_xfer = mv64xxx_i2c_xfer, 801 - .master_xfer_atomic = mv64xxx_i2c_xfer_atomic, 800 + .xfer = mv64xxx_i2c_xfer, 801 + .xfer_atomic = mv64xxx_i2c_xfer_atomic, 802 802 .functionality = mv64xxx_i2c_functionality, 803 803 }; 804 804
+3 -4
drivers/i2c/busses/i2c-nvidia-gpu.c
··· 163 163 return gpu_i2c_check_status(i2cd); 164 164 } 165 165 166 - static int gpu_i2c_master_xfer(struct i2c_adapter *adap, 167 - struct i2c_msg *msgs, int num) 166 + static int gpu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) 168 167 { 169 168 struct gpu_i2c_dev *i2cd = i2c_get_adapdata(adap); 170 169 int status, status2; ··· 233 234 } 234 235 235 236 static const struct i2c_algorithm gpu_i2c_algorithm = { 236 - .master_xfer = gpu_i2c_master_xfer, 237 - .functionality = gpu_i2c_functionality, 237 + .xfer = gpu_i2c_xfer, 238 + .functionality = gpu_i2c_functionality, 238 239 }; 239 240 240 241 /*
+4 -4
drivers/i2c/busses/i2c-ocores.c
··· 444 444 } 445 445 446 446 static struct i2c_algorithm ocores_algorithm = { 447 - .master_xfer = ocores_xfer, 448 - .master_xfer_atomic = ocores_xfer_polling, 447 + .xfer = ocores_xfer, 448 + .xfer_atomic = ocores_xfer_polling, 449 449 .functionality = ocores_func, 450 450 }; 451 451 ··· 682 682 } 683 683 684 684 if (irq == -ENXIO) { 685 - ocores_algorithm.master_xfer = ocores_xfer_polling; 685 + ocores_algorithm.xfer = ocores_xfer_polling; 686 686 } else { 687 687 if (irq < 0) 688 688 return irq; 689 689 } 690 690 691 - if (ocores_algorithm.master_xfer != ocores_xfer_polling) { 691 + if (ocores_algorithm.xfer != ocores_xfer_polling) { 692 692 ret = devm_request_any_context_irq(&pdev->dev, irq, 693 693 ocores_isr, 0, 694 694 pdev->name, i2c);
+3 -3
drivers/i2c/busses/i2c-octeon-core.c
··· 221 221 case STAT_LOST_ARB_B0: 222 222 return -EAGAIN; 223 223 224 - /* Being addressed as slave, should back off & listen */ 224 + /* Being addressed as local target, should back off & listen */ 225 225 case STAT_SLAVE_60: 226 226 case STAT_SLAVE_70: 227 227 case STAT_GENDATA_ACK: 228 228 case STAT_GENDATA_NAK: 229 229 return -EOPNOTSUPP; 230 230 231 - /* Core busy as slave */ 231 + /* Core busy as local target */ 232 232 case STAT_SLAVE_80: 233 233 case STAT_SLAVE_88: 234 234 case STAT_SLAVE_A0: ··· 608 608 } 609 609 610 610 /** 611 - * octeon_i2c_xfer - The driver's master_xfer function 611 + * octeon_i2c_xfer - The driver's xfer function 612 612 * @adap: Pointer to the i2c_adapter structure 613 613 * @msgs: Pointer to the messages to be processed 614 614 * @num: Length of the MSGS array
+2 -2
drivers/i2c/busses/i2c-octeon-core.h
··· 39 39 /* Controller command and status bits */ 40 40 #define TWSI_CTL_CE 0x80 /* High level controller enable */ 41 41 #define TWSI_CTL_ENAB 0x40 /* Bus enable */ 42 - #define TWSI_CTL_STA 0x20 /* Master-mode start, HW clears when done */ 43 - #define TWSI_CTL_STP 0x10 /* Master-mode stop, HW clears when done */ 42 + #define TWSI_CTL_STA 0x20 /* Controller-mode start, HW clears when done */ 43 + #define TWSI_CTL_STP 0x10 /* Controller-mode stop, HW clears when done */ 44 44 #define TWSI_CTL_IFLG 0x08 /* HW event, SW writes 0 to ACK */ 45 45 #define TWSI_CTL_AAK 0x04 /* Assert ACK */ 46 46
+1 -1
drivers/i2c/busses/i2c-octeon-platdrv.c
··· 122 122 } 123 123 124 124 static const struct i2c_algorithm octeon_i2c_algo = { 125 - .master_xfer = octeon_i2c_xfer, 125 + .xfer = octeon_i2c_xfer, 126 126 .functionality = octeon_i2c_functionality, 127 127 }; 128 128
+29 -7
drivers/i2c/busses/i2c-omap.c
··· 1534 1534 pm_runtime_disable(&pdev->dev); 1535 1535 } 1536 1536 1537 - static int __maybe_unused omap_i2c_runtime_suspend(struct device *dev) 1537 + static int omap_i2c_runtime_suspend(struct device *dev) 1538 1538 { 1539 1539 struct omap_i2c_dev *omap = dev_get_drvdata(dev); 1540 1540 ··· 1560 1560 return 0; 1561 1561 } 1562 1562 1563 - static int __maybe_unused omap_i2c_runtime_resume(struct device *dev) 1563 + static int omap_i2c_runtime_resume(struct device *dev) 1564 1564 { 1565 1565 struct omap_i2c_dev *omap = dev_get_drvdata(dev); 1566 1566 ··· 1574 1574 return 0; 1575 1575 } 1576 1576 1577 + static int omap_i2c_suspend(struct device *dev) 1578 + { 1579 + /* 1580 + * If the controller is autosuspended, there is no way to wakeup it once 1581 + * runtime pm is disabled (in suspend_late()). 1582 + * But a device may need the controller up during suspend_noirq() or 1583 + * resume_noirq(). 1584 + * Wakeup the controller while runtime pm is enabled, so it is available 1585 + * until its suspend_noirq(), and from resume_noirq(). 1586 + */ 1587 + return pm_runtime_resume_and_get(dev); 1588 + } 1589 + 1590 + static int omap_i2c_resume(struct device *dev) 1591 + { 1592 + pm_runtime_mark_last_busy(dev); 1593 + pm_runtime_put_autosuspend(dev); 1594 + 1595 + return 0; 1596 + } 1597 + 1577 1598 static const struct dev_pm_ops omap_i2c_pm_ops = { 1578 - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 1579 - pm_runtime_force_resume) 1580 - SET_RUNTIME_PM_OPS(omap_i2c_runtime_suspend, 1581 - omap_i2c_runtime_resume, NULL) 1599 + NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 1600 + pm_runtime_force_resume) 1601 + SYSTEM_SLEEP_PM_OPS(omap_i2c_suspend, omap_i2c_resume) 1602 + RUNTIME_PM_OPS(omap_i2c_runtime_suspend, 1603 + omap_i2c_runtime_resume, NULL) 1582 1604 }; 1583 1605 1584 1606 static struct platform_driver omap_i2c_driver = { ··· 1608 1586 .remove_new = omap_i2c_remove, 1609 1587 .driver = { 1610 1588 .name = "omap_i2c", 1611 - .pm = &omap_i2c_pm_ops, 1589 + .pm = pm_ptr(&omap_i2c_pm_ops), 1612 1590 .of_match_table = of_match_ptr(omap_i2c_of_match), 1613 1591 }, 1614 1592 };
+5 -5
drivers/i2c/busses/i2c-opal.c
··· 70 70 return rc; 71 71 } 72 72 73 - static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, 74 - int num) 73 + static int i2c_opal_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, 74 + int num) 75 75 { 76 76 unsigned long opal_id = (unsigned long)adap->algo_data; 77 77 struct opal_i2c_request req; ··· 179 179 } 180 180 181 181 static const struct i2c_algorithm i2c_opal_algo = { 182 - .master_xfer = i2c_opal_master_xfer, 183 - .smbus_xfer = i2c_opal_smbus_xfer, 184 - .functionality = i2c_opal_func, 182 + .xfer = i2c_opal_xfer, 183 + .smbus_xfer = i2c_opal_smbus_xfer, 184 + .functionality = i2c_opal_func, 185 185 }; 186 186 187 187 /*
+6 -6
drivers/i2c/busses/i2c-owl.c
··· 172 172 173 173 i2c_dev->err = 0; 174 174 175 - /* Handle NACK from slave */ 175 + /* Handle NACK from target */ 176 176 fifostat = readl(i2c_dev->base + OWL_I2C_REG_FIFOSTAT); 177 177 if (fifostat & OWL_I2C_FIFOSTAT_RNB) { 178 178 i2c_dev->err = -ENXIO; ··· 302 302 OWL_I2C_CTL_IRQE, !atomic); 303 303 304 304 /* 305 - * Select: FIFO enable, Master mode, Stop enable, Data count enable, 305 + * Select: FIFO enable, controller mode, Stop enable, Data count enable, 306 306 * Send start bit 307 307 */ 308 308 i2c_cmd = OWL_I2C_CMD_SECL | OWL_I2C_CMD_MSS | OWL_I2C_CMD_SE | ··· 314 314 i2c_cmd |= OWL_I2C_CMD_AS(msgs[0].len + 1) | 315 315 OWL_I2C_CMD_SAS(1) | OWL_I2C_CMD_RBE; 316 316 317 - /* Write slave address */ 317 + /* Write target address */ 318 318 addr = i2c_8bit_addr_from_msg(&msgs[0]); 319 319 writel(addr, i2c_dev->base + OWL_I2C_REG_TXDAT); 320 320 ··· 420 420 } 421 421 422 422 static const struct i2c_algorithm owl_i2c_algorithm = { 423 - .master_xfer = owl_i2c_xfer, 424 - .master_xfer_atomic = owl_i2c_xfer_atomic, 425 - .functionality = owl_i2c_func, 423 + .xfer = owl_i2c_xfer, 424 + .xfer_atomic = owl_i2c_xfer_atomic, 425 + .functionality = owl_i2c_func, 426 426 }; 427 427 428 428 static const struct i2c_adapter_quirks owl_i2c_quirks = {
+3 -3
drivers/i2c/busses/i2c-pasemi-core.c
··· 336 336 } 337 337 338 338 static const struct i2c_algorithm smbus_algorithm = { 339 - .master_xfer = pasemi_i2c_xfer, 340 - .smbus_xfer = pasemi_smb_xfer, 341 - .functionality = pasemi_smb_func, 339 + .xfer = pasemi_i2c_xfer, 340 + .smbus_xfer = pasemi_smb_xfer, 341 + .functionality = pasemi_smb_func, 342 342 }; 343 343 344 344 int pasemi_i2c_common_probe(struct pasemi_smbus *smbus)
+1 -1
drivers/i2c/busses/i2c-piix4.c
··· 589 589 result = -EIO; 590 590 dev_dbg(&piix4_adapter->dev, "Bus collision! SMBus may be " 591 591 "locked until next hard reset. (sorry!)\n"); 592 - /* Clock stops and slave is stuck in mid-transmission */ 592 + /* Clock stops and target is stuck in mid-transmission */ 593 593 } 594 594 595 595 if (temp & 0x04) {
+7 -7
drivers/i2c/busses/i2c-powermac.c
··· 127 127 } 128 128 129 129 /* 130 - * Generic i2c master transfer entrypoint. This driver only support single 130 + * Generic i2c transfer entrypoint. This driver only supports single 131 131 * messages (for "lame i2c" transfers). Anything else should use the smbus 132 132 * entry point 133 133 */ 134 - static int i2c_powermac_master_xfer( struct i2c_adapter *adap, 135 - struct i2c_msg *msgs, 136 - int num) 134 + static int i2c_powermac_xfer(struct i2c_adapter *adap, 135 + struct i2c_msg *msgs, 136 + int num) 137 137 { 138 138 struct pmac_i2c_bus *bus = i2c_get_adapdata(adap); 139 139 int rc = 0; ··· 179 179 180 180 /* For now, we only handle smbus */ 181 181 static const struct i2c_algorithm i2c_powermac_algorithm = { 182 - .smbus_xfer = i2c_powermac_smbus_xfer, 183 - .master_xfer = i2c_powermac_master_xfer, 184 - .functionality = i2c_powermac_func, 182 + .smbus_xfer = i2c_powermac_smbus_xfer, 183 + .xfer = i2c_powermac_xfer, 184 + .functionality = i2c_powermac_func, 185 185 }; 186 186 187 187 static const struct i2c_adapter_quirks i2c_powermac_quirks = {
+1 -1
drivers/i2c/busses/i2c-pxa-pci.c
··· 4 4 * Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de> 5 5 * 6 6 * The CE4100's I2C device is more or less the same one as found on PXA. 7 - * It does not support slave mode, the register slightly moved. This PCI 7 + * It does not support target mode, the register slightly moved. This PCI 8 8 * device provides three bars, every contains a single I2C controller. 9 9 */ 10 10 #include <linux/init.h>
+1
drivers/i2c/busses/i2c-pxa.c
··· 1593 1593 platform_driver_unregister(&i2c_pxa_driver); 1594 1594 } 1595 1595 1596 + MODULE_DESCRIPTION("Intel PXA2XX I2C adapter"); 1596 1597 MODULE_LICENSE("GPL"); 1597 1598 1598 1599 subsys_initcall(i2c_adap_pxa_init);
+1
drivers/i2c/busses/i2c-qup.c
··· 1985 1985 1986 1986 module_platform_driver(qup_i2c_driver); 1987 1987 1988 + MODULE_DESCRIPTION("Qualcomm QUP based I2C controller"); 1988 1989 MODULE_LICENSE("GPL v2"); 1989 1990 MODULE_ALIAS("platform:i2c_qup");
+6 -7
drivers/i2c/busses/i2c-rcar.c
··· 191 191 struct rcar_i2c_priv *priv = i2c_get_adapdata(adap); 192 192 193 193 return !!(rcar_i2c_read(priv, ICMCR) & FSCL); 194 - 195 - }; 194 + } 196 195 197 196 static void rcar_i2c_set_scl(struct i2c_adapter *adap, int val) 198 197 { ··· 203 204 priv->recovery_icmcr &= ~FSCL; 204 205 205 206 rcar_i2c_write(priv, ICMCR, priv->recovery_icmcr); 206 - }; 207 + } 207 208 208 209 static void rcar_i2c_set_sda(struct i2c_adapter *adap, int val) 209 210 { ··· 215 216 priv->recovery_icmcr &= ~FSDA; 216 217 217 218 rcar_i2c_write(priv, ICMCR, priv->recovery_icmcr); 218 - }; 219 + } 219 220 220 221 static int rcar_i2c_get_bus_free(struct i2c_adapter *adap) 221 222 { 222 223 struct rcar_i2c_priv *priv = i2c_get_adapdata(adap); 223 224 224 225 return !(rcar_i2c_read(priv, ICMCR) & FSDA); 225 - 226 - }; 226 + } 227 227 228 228 static struct i2c_bus_recovery_info rcar_i2c_bri = { 229 229 .get_scl = rcar_i2c_get_scl, ··· 231 233 .get_bus_free = rcar_i2c_get_bus_free, 232 234 .recover_bus = i2c_generic_scl_recovery, 233 235 }; 236 + 234 237 static void rcar_i2c_init(struct rcar_i2c_priv *priv) 235 238 { 236 239 /* reset master mode */ ··· 552 553 u32 irqs_to_clear = MDE; 553 554 554 555 /* FIXME: sometimes, unknown interrupt happened. Do nothing */ 555 - if (!(msr & MDE)) 556 + if (WARN(!(msr & MDE), "spurious irq")) 556 557 return; 557 558 558 559 if (msr & MAT)
+4 -4
drivers/i2c/busses/i2c-riic.c
··· 12 12 * 13 13 * 1) The main xfer routine kicks off a transmission by putting the start bit 14 14 * (or repeated start) on the bus and enabling the transmit interrupt (TIE) 15 - * since we need to send the slave address + RW bit in every case. 15 + * since we need to send the target address + RW bit in every case. 16 16 * 17 - * 2) TIE sends slave address + RW bit and selects how to continue. 17 + * 2) TIE sends target address + RW bit and selects how to continue. 18 18 * 19 19 * 3a) Write case: We keep utilizing TIE as long as we have data to send. If we 20 20 * are done, we switch over to the transmission done interrupt (TEIE) and mark ··· 294 294 } 295 295 296 296 static const struct i2c_algorithm riic_algo = { 297 - .master_xfer = riic_xfer, 298 - .functionality = riic_func, 297 + .xfer = riic_xfer, 298 + .functionality = riic_func, 299 299 }; 300 300 301 301 static int riic_init_hw(struct riic_dev *riic, struct i2c_timings *t)
+10 -10
drivers/i2c/busses/i2c-rk3x.c
··· 28 28 /* Register Map */ 29 29 #define REG_CON 0x00 /* control register */ 30 30 #define REG_CLKDIV 0x04 /* clock divisor register */ 31 - #define REG_MRXADDR 0x08 /* slave address for REGISTER_TX */ 32 - #define REG_MRXRADDR 0x0c /* slave register address for REGISTER_TX */ 31 + #define REG_MRXADDR 0x08 /* target address for REGISTER_TX */ 32 + #define REG_MRXRADDR 0x0c /* target register address for REGISTER_TX */ 33 33 #define REG_MTXCNT 0x10 /* number of bytes to be transmitted */ 34 34 #define REG_MRXCNT 0x14 /* number of bytes to be received */ 35 35 #define REG_IEN 0x18 /* interrupt enable */ ··· 68 68 /* REG_IEN/REG_IPD bits */ 69 69 #define REG_INT_BTF BIT(0) /* a byte was transmitted */ 70 70 #define REG_INT_BRF BIT(1) /* a byte was received */ 71 - #define REG_INT_MBTF BIT(2) /* master data transmit finished */ 72 - #define REG_INT_MBRF BIT(3) /* master data receive finished */ 71 + #define REG_INT_MBTF BIT(2) /* controller data transmit finished */ 72 + #define REG_INT_MBRF BIT(3) /* controller data receive finished */ 73 73 #define REG_INT_START BIT(4) /* START condition generated */ 74 74 #define REG_INT_STOP BIT(5) /* STOP condition generated */ 75 75 #define REG_INT_NAKRCV BIT(6) /* NACK received */ ··· 184 184 * @wait: the waitqueue to wait for i2c transfer 185 185 * @busy: the condition for the event to wait for 186 186 * @msg: current i2c message 187 - * @addr: addr of i2c slave device 187 + * @addr: addr of i2c target device 188 188 * @mode: mode of i2c transfer 189 189 * @is_last_msg: flag determines whether it is the last msg in this transfer 190 190 * @state: state of i2c transfer ··· 979 979 /* 980 980 * The I2C adapter can issue a small (len < 4) write packet before 981 981 * reading. This speeds up SMBus-style register reads. 982 - * The MRXADDR/MRXRADDR hold the slave address and the slave register 982 + * The MRXADDR/MRXRADDR hold the target address and the target register 983 983 * address in this case. 984 984 */ 985 985 ··· 1016 1016 addr |= 1; /* set read bit */ 1017 1017 1018 1018 /* 1019 - * We have to transmit the slave addr first. Use 1019 + * We have to transmit the target addr first. Use 1020 1020 * MOD_REGISTER_TX for that purpose. 1021 1021 */ 1022 1022 i2c->mode = REG_CON_MOD_REGISTER_TX; ··· 1160 1160 } 1161 1161 1162 1162 static const struct i2c_algorithm rk3x_i2c_algorithm = { 1163 - .master_xfer = rk3x_i2c_xfer, 1164 - .master_xfer_atomic = rk3x_i2c_xfer_polling, 1165 - .functionality = rk3x_i2c_func, 1163 + .xfer = rk3x_i2c_xfer, 1164 + .xfer_atomic = rk3x_i2c_xfer_polling, 1165 + .functionality = rk3x_i2c_func, 1166 1166 }; 1167 1167 1168 1168 static const struct rk3x_i2c_soc_data rv1108_soc_data = {
+2 -2
drivers/i2c/busses/i2c-robotfuzz-osif.c
··· 112 112 } 113 113 114 114 static const struct i2c_algorithm osif_algorithm = { 115 - .master_xfer = osif_xfer, 116 - .functionality = osif_func, 115 + .xfer = osif_xfer, 116 + .functionality = osif_func, 117 117 }; 118 118 119 119 #define USB_OSIF_VENDOR_ID 0x1964
+6 -6
drivers/i2c/busses/i2c-rzv2m.c
··· 321 321 100, jiffies_to_usecs(priv->adap.timeout)); 322 322 } 323 323 324 - static int rzv2m_i2c_master_xfer_msg(struct rzv2m_i2c_priv *priv, 325 - struct i2c_msg *msg, int stop) 324 + static int rzv2m_i2c_xfer_msg(struct rzv2m_i2c_priv *priv, 325 + struct i2c_msg *msg, int stop) 326 326 { 327 327 unsigned int count = 0; 328 328 int ret, read = !!(msg->flags & I2C_M_RD); ··· 351 351 return ret; 352 352 } 353 353 354 - static int rzv2m_i2c_master_xfer(struct i2c_adapter *adap, 355 - struct i2c_msg *msgs, int num) 354 + static int rzv2m_i2c_xfer(struct i2c_adapter *adap, 355 + struct i2c_msg *msgs, int num) 356 356 { 357 357 struct rzv2m_i2c_priv *priv = i2c_get_adapdata(adap); 358 358 struct device *dev = priv->adap.dev.parent; ··· 370 370 371 371 /* I2C main transfer */ 372 372 for (i = 0; i < num; i++) { 373 - ret = rzv2m_i2c_master_xfer_msg(priv, &msgs[i], i == (num - 1)); 373 + ret = rzv2m_i2c_xfer_msg(priv, &msgs[i], i == (num - 1)); 374 374 if (ret < 0) 375 375 goto out; 376 376 } ··· 408 408 }; 409 409 410 410 static struct i2c_algorithm rzv2m_i2c_algo = { 411 - .master_xfer = rzv2m_i2c_master_xfer, 411 + .xfer = rzv2m_i2c_xfer, 412 412 .functionality = rzv2m_i2c_func, 413 413 }; 414 414
+1 -1
drivers/i2c/busses/i2c-sis5595.c
··· 257 257 if (temp & 0x20) { 258 258 dev_err(&adap->dev, "Bus collision! SMBus may be locked until " 259 259 "next hard reset (or not...)\n"); 260 - /* Clock stops and slave is stuck in mid-transmission */ 260 + /* Clock stops and target is stuck in mid-transmission */ 261 261 result = -EIO; 262 262 } 263 263
+8 -8
drivers/i2c/busses/i2c-sprd.c
··· 283 283 return i2c_dev->err; 284 284 } 285 285 286 - static int sprd_i2c_master_xfer(struct i2c_adapter *i2c_adap, 287 - struct i2c_msg *msgs, int num) 286 + static int sprd_i2c_xfer(struct i2c_adapter *i2c_adap, 287 + struct i2c_msg *msgs, int num) 288 288 { 289 289 struct sprd_i2c *i2c_dev = i2c_adap->algo_data; 290 290 int im, ret; ··· 314 314 } 315 315 316 316 static const struct i2c_algorithm sprd_i2c_algo = { 317 - .master_xfer = sprd_i2c_master_xfer, 317 + .xfer = sprd_i2c_xfer, 318 318 .functionality = sprd_i2c_func, 319 319 }; 320 320 ··· 378 378 i2c_tran = i2c_dev->count; 379 379 380 380 /* 381 - * If we got one ACK from slave when writing data, and we did not 381 + * If we got one ACK from target when writing data, and we did not 382 382 * finish this transmission (i2c_tran is not zero), then we should 383 383 * continue to write data. 384 384 * 385 385 * For reading data, ack is always true, if i2c_tran is not 0 which 386 - * means we still need to contine to read data from slave. 386 + * means we still need to contine to read data from target. 387 387 */ 388 388 if (i2c_tran && ack) { 389 389 sprd_i2c_data_transfer(i2c_dev); ··· 393 393 i2c_dev->err = 0; 394 394 395 395 /* 396 - * If we did not get one ACK from slave when writing data, we should 396 + * If we did not get one ACK from target when writing data, we should 397 397 * return -EIO to notify users. 398 398 */ 399 399 if (!ack) ··· 422 422 i2c_tran = i2c_dev->count; 423 423 424 424 /* 425 - * If we did not get one ACK from slave when writing data, then we 425 + * If we did not get one ACK from target when writing data, then we 426 426 * should finish this transmission since we got some errors. 427 427 * 428 428 * When writing data, if i2c_tran == 0 which means we have writen ··· 653 653 654 654 module_platform_driver(sprd_i2c_driver); 655 655 656 - MODULE_DESCRIPTION("Spreadtrum I2C master controller driver"); 656 + MODULE_DESCRIPTION("Spreadtrum I2C controller driver"); 657 657 MODULE_LICENSE("GPL v2");
+4 -4
drivers/i2c/busses/i2c-st.c
··· 2 2 /* 3 3 * Copyright (C) 2013 STMicroelectronics 4 4 * 5 - * I2C master mode controller driver, used in STMicroelectronics devices. 5 + * I2C controller driver, used in STMicroelectronics devices. 6 6 * 7 7 * Author: Maxime Coquelin <maxime.coquelin@st.com> 8 8 */ ··· 150 150 151 151 /** 152 152 * struct st_i2c_client - client specific data 153 - * @addr: 8-bit slave addr, including r/w bit 153 + * @addr: 8-bit target addr, including r/w bit 154 154 * @count: number of bytes to be transfered 155 155 * @xfered: number of bytes already transferred 156 156 * @buf: data buffer ··· 667 667 i2c |= SSC_I2C_ACKG; 668 668 st_i2c_set_bits(i2c_dev->base + SSC_I2C, i2c); 669 669 670 - /* Write slave address */ 670 + /* Write target address */ 671 671 st_i2c_write_tx_fifo(i2c_dev, c->addr); 672 672 673 673 /* Pre-fill Tx fifo with data in case of write */ ··· 766 766 } 767 767 768 768 static const struct i2c_algorithm st_i2c_algo = { 769 - .master_xfer = st_i2c_xfer, 769 + .xfer = st_i2c_xfer, 770 770 .functionality = st_i2c_func, 771 771 }; 772 772
+4 -4
drivers/i2c/busses/i2c-stm32f4.c
··· 95 95 96 96 /** 97 97 * struct stm32f4_i2c_msg - client specific data 98 - * @addr: 8-bit slave addr, including r/w bit 98 + * @addr: 8-bit target addr, including r/w bit 99 99 * @count: number of bytes to be transferred 100 100 * @buf: data buffer 101 101 * @result: result of the transfer ··· 480 480 481 481 /** 482 482 * stm32f4_i2c_handle_rx_addr() - Handle address matched interrupt in case of 483 - * master receiver 483 + * controller receiver 484 484 * @i2c_dev: Controller's private data 485 485 */ 486 486 static void stm32f4_i2c_handle_rx_addr(struct stm32f4_i2c_dev *i2c_dev) ··· 643 643 644 644 /* 645 645 * Acknowledge failure: 646 - * In master transmitter mode a Stop must be generated by software 646 + * In controller transmitter mode a Stop must be generated by software 647 647 */ 648 648 if (status & STM32F4_I2C_SR1_AF) { 649 649 if (!(msg->addr & I2C_M_RD)) { ··· 749 749 } 750 750 751 751 static const struct i2c_algorithm stm32f4_i2c_algo = { 752 - .master_xfer = stm32f4_i2c_xfer, 752 + .xfer = stm32f4_i2c_xfer, 753 753 .functionality = stm32f4_i2c_func, 754 754 }; 755 755
+10 -10
drivers/i2c/busses/i2c-sun6i-p2wi.c
··· 10 10 * The P2WI controller looks like an SMBus controller which only supports byte 11 11 * data transfers. But, it differs from standard SMBus protocol on several 12 12 * aspects: 13 - * - it supports only one slave device, and thus drop the address field 13 + * - it supports only one target device, and thus drop the address field 14 14 * - it adds a parity bit every 8bits of data 15 15 * - only one read access is required to read a byte (instead of a write 16 16 * followed by a read access in standard SMBus protocol) ··· 88 88 void __iomem *regs; 89 89 struct clk *clk; 90 90 struct reset_control *rstc; 91 - int slave_addr; 91 + int target_addr; 92 92 }; 93 93 94 94 static irqreturn_t p2wi_interrupt(int irq, void *dev_id) ··· 121 121 struct p2wi *p2wi = i2c_get_adapdata(adap); 122 122 unsigned long dlen = P2WI_DLEN_DATA_LENGTH(1); 123 123 124 - if (p2wi->slave_addr >= 0 && addr != p2wi->slave_addr) { 124 + if (p2wi->target_addr >= 0 && addr != p2wi->target_addr) { 125 125 dev_err(&adap->dev, "invalid P2WI address\n"); 126 126 return -EINVAL; 127 127 } ··· 188 188 unsigned long parent_clk_freq; 189 189 u32 clk_freq = I2C_MAX_STANDARD_MODE_FREQ; 190 190 struct p2wi *p2wi; 191 - u32 slave_addr; 191 + u32 target_addr; 192 192 int clk_div; 193 193 int irq; 194 194 int ret; ··· 207 207 } 208 208 209 209 if (of_get_child_count(np) > 1) { 210 - dev_err(dev, "P2WI only supports one slave device\n"); 210 + dev_err(dev, "P2WI only supports one target device\n"); 211 211 return -EINVAL; 212 212 } 213 213 ··· 215 215 if (!p2wi) 216 216 return -ENOMEM; 217 217 218 - p2wi->slave_addr = -1; 218 + p2wi->target_addr = -1; 219 219 220 220 /* 221 221 * Authorize a p2wi node without any children to be able to use an 222 222 * i2c-dev from userpace. 223 - * In this case the slave_addr is set to -1 and won't be checked when 223 + * In this case the target_addr is set to -1 and won't be checked when 224 224 * launching a P2WI transfer. 225 225 */ 226 226 childnp = of_get_next_available_child(np, NULL); 227 227 if (childnp) { 228 - ret = of_property_read_u32(childnp, "reg", &slave_addr); 228 + ret = of_property_read_u32(childnp, "reg", &target_addr); 229 229 if (ret) { 230 - dev_err(dev, "invalid slave address on node %pOF\n", 230 + dev_err(dev, "invalid target address on node %pOF\n", 231 231 childnp); 232 232 return -EINVAL; 233 233 } 234 234 235 - p2wi->slave_addr = slave_addr; 235 + p2wi->target_addr = target_addr; 236 236 } 237 237 238 238 p2wi->regs = devm_platform_ioremap_resource(pdev, 0);
+1 -1
drivers/i2c/busses/i2c-taos-evm.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 3 * Driver for the TAOS evaluation modules 4 - * These devices include an I2C master which can be controlled over the 4 + * These devices include an I2C controller which can be controlled over the 5 5 * serial port. 6 6 * 7 7 * Copyright (C) 2007 Jean Delvare <jdelvare@suse.de>
+2 -2
drivers/i2c/busses/i2c-tegra-bpmp.c
··· 275 275 } 276 276 277 277 static const struct i2c_algorithm tegra_bpmp_i2c_algo = { 278 - .master_xfer = tegra_bpmp_i2c_xfer, 279 - .master_xfer_atomic = tegra_bpmp_i2c_xfer_atomic, 278 + .xfer = tegra_bpmp_i2c_xfer, 279 + .xfer_atomic = tegra_bpmp_i2c_xfer_atomic, 280 280 .functionality = tegra_bpmp_i2c_func, 281 281 }; 282 282
+1 -1
drivers/i2c/busses/i2c-thunderx-pcidrv.c
··· 72 72 } 73 73 74 74 static const struct i2c_algorithm thunderx_i2c_algo = { 75 - .master_xfer = octeon_i2c_xfer, 75 + .xfer = octeon_i2c_xfer, 76 76 .functionality = thunderx_i2c_functionality, 77 77 }; 78 78
+2 -4
drivers/i2c/busses/i2c-tiny-usb.c
··· 54 54 struct i2c_msg *pmsg; 55 55 int i, ret; 56 56 57 - dev_dbg(&adapter->dev, "master xfer %d messages:\n", num); 58 - 59 57 pstatus = kmalloc(sizeof(*pstatus), GFP_KERNEL); 60 58 if (!pstatus) 61 59 return -ENOMEM; ··· 140 142 141 143 /* This is the actual algorithm we define */ 142 144 static const struct i2c_algorithm usb_algorithm = { 143 - .master_xfer = usb_xfer, 144 - .functionality = usb_func, 145 + .xfer = usb_xfer, 146 + .functionality = usb_func, 145 147 }; 146 148 147 149 /* ----- end of i2c layer ------------------------------------------------ */
+12 -14
drivers/i2c/busses/i2c-uniphier-f.c
··· 12 12 #include <linux/platform_device.h> 13 13 14 14 #define UNIPHIER_FI2C_CR 0x00 /* control register */ 15 - #define UNIPHIER_FI2C_CR_MST BIT(3) /* master mode */ 15 + #define UNIPHIER_FI2C_CR_MST BIT(3) /* controller mode */ 16 16 #define UNIPHIER_FI2C_CR_STA BIT(2) /* start condition */ 17 17 #define UNIPHIER_FI2C_CR_STO BIT(1) /* stop condition */ 18 18 #define UNIPHIER_FI2C_CR_NACK BIT(0) /* do not return ACK */ 19 19 #define UNIPHIER_FI2C_DTTX 0x04 /* TX FIFO */ 20 - #define UNIPHIER_FI2C_DTTX_CMD BIT(8) /* send command (slave addr) */ 20 + #define UNIPHIER_FI2C_DTTX_CMD BIT(8) /* send command (target addr) */ 21 21 #define UNIPHIER_FI2C_DTTX_RD BIT(0) /* read transaction */ 22 22 #define UNIPHIER_FI2C_DTRX 0x04 /* RX FIFO */ 23 - #define UNIPHIER_FI2C_SLAD 0x0c /* slave address */ 23 + #define UNIPHIER_FI2C_SLAD 0x0c /* target address */ 24 24 #define UNIPHIER_FI2C_CYC 0x10 /* clock cycle control */ 25 25 #define UNIPHIER_FI2C_LCTL 0x14 /* clock low period control */ 26 26 #define UNIPHIER_FI2C_SSUT 0x18 /* restart/stop setup time control */ ··· 96 96 int fifo_space = UNIPHIER_FI2C_FIFO_SIZE; 97 97 98 98 /* 99 - * TX-FIFO stores slave address in it for the first access. 99 + * TX-FIFO stores target address in it for the first access. 100 100 * Decrement the counter. 101 101 */ 102 102 if (first) ··· 252 252 253 253 /* do not use TX byte counter */ 254 254 writel(0, priv->membase + UNIPHIER_FI2C_TBC); 255 - /* set slave address */ 255 + /* set target address */ 256 256 writel(UNIPHIER_FI2C_DTTX_CMD | addr << 1, 257 257 priv->membase + UNIPHIER_FI2C_DTTX); 258 258 /* ··· 288 288 289 289 uniphier_fi2c_set_irqs(priv); 290 290 291 - /* set slave address with RD bit */ 291 + /* set target address with RD bit */ 292 292 writel(UNIPHIER_FI2C_DTTX_CMD | UNIPHIER_FI2C_DTTX_RD | addr << 1, 293 293 priv->membase + UNIPHIER_FI2C_DTTX); 294 294 } ··· 310 310 i2c_recover_bus(&priv->adap); 311 311 } 312 312 313 - static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap, 314 - struct i2c_msg *msg, bool repeat, 315 - bool stop) 313 + static int uniphier_fi2c_xfer_one(struct i2c_adapter *adap, struct i2c_msg *msg, 314 + bool repeat, bool stop) 316 315 { 317 316 struct uniphier_fi2c_priv *priv = i2c_get_adapdata(adap); 318 317 bool is_read = msg->flags & I2C_M_RD; ··· 339 340 uniphier_fi2c_tx_init(priv, msg->addr, repeat); 340 341 341 342 /* 342 - * For a repeated START condition, writing a slave address to the FIFO 343 + * For a repeated START condition, writing a target address to the FIFO 343 344 * kicks the controller. So, the UNIPHIER_FI2C_CR register should be 344 345 * written only for a non-repeated START condition. 345 346 */ ··· 402 403 return 0; 403 404 } 404 405 405 - static int uniphier_fi2c_master_xfer(struct i2c_adapter *adap, 406 - struct i2c_msg *msgs, int num) 406 + static int uniphier_fi2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) 407 407 { 408 408 struct i2c_msg *msg, *emsg = msgs + num; 409 409 bool repeat = false; ··· 416 418 /* Emit STOP if it is the last message or I2C_M_STOP is set. */ 417 419 bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP); 418 420 419 - ret = uniphier_fi2c_master_xfer_one(adap, msg, repeat, stop); 421 + ret = uniphier_fi2c_xfer_one(adap, msg, repeat, stop); 420 422 if (ret) 421 423 return ret; 422 424 ··· 432 434 } 433 435 434 436 static const struct i2c_algorithm uniphier_fi2c_algo = { 435 - .master_xfer = uniphier_fi2c_master_xfer, 437 + .xfer = uniphier_fi2c_xfer, 436 438 .functionality = uniphier_fi2c_functionality, 437 439 }; 438 440
+7 -8
drivers/i2c/busses/i2c-uniphier.c
··· 17 17 #define UNIPHIER_I2C_DTRM_NACK BIT(8) /* do not return ACK */ 18 18 #define UNIPHIER_I2C_DTRM_RD BIT(0) /* read transaction */ 19 19 #define UNIPHIER_I2C_DREC 0x04 /* RX register */ 20 - #define UNIPHIER_I2C_DREC_MST BIT(14) /* 1 = master, 0 = slave */ 20 + #define UNIPHIER_I2C_DREC_MST BIT(14) /* 1 = controller, 0 = target */ 21 21 #define UNIPHIER_I2C_DREC_TX BIT(13) /* 1 = transmit, 0 = receive */ 22 22 #define UNIPHIER_I2C_DREC_STS BIT(12) /* stop condition detected */ 23 23 #define UNIPHIER_I2C_DREC_LRB BIT(11) /* no ACK */ 24 24 #define UNIPHIER_I2C_DREC_LAB BIT(9) /* arbitration lost */ 25 25 #define UNIPHIER_I2C_DREC_BBN BIT(8) /* bus not busy */ 26 - #define UNIPHIER_I2C_MYAD 0x08 /* slave address */ 26 + #define UNIPHIER_I2C_MYAD 0x08 /* local target address */ 27 27 #define UNIPHIER_I2C_CLK 0x0c /* clock frequency control */ 28 28 #define UNIPHIER_I2C_BRST 0x10 /* bus reset */ 29 29 #define UNIPHIER_I2C_BRST_FOEN BIT(1) /* normal operation */ ··· 152 152 UNIPHIER_I2C_DTRM_NACK); 153 153 } 154 154 155 - static int uniphier_i2c_master_xfer_one(struct i2c_adapter *adap, 156 - struct i2c_msg *msg, bool stop) 155 + static int uniphier_i2c_xfer_one(struct i2c_adapter *adap, 156 + struct i2c_msg *msg, bool stop) 157 157 { 158 158 bool is_read = msg->flags & I2C_M_RD; 159 159 bool recovery = false; ··· 211 211 return 0; 212 212 } 213 213 214 - static int uniphier_i2c_master_xfer(struct i2c_adapter *adap, 215 - struct i2c_msg *msgs, int num) 214 + static int uniphier_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) 216 215 { 217 216 struct i2c_msg *msg, *emsg = msgs + num; 218 217 int ret; ··· 224 225 /* Emit STOP if it is the last message or I2C_M_STOP is set. */ 225 226 bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP); 226 227 227 - ret = uniphier_i2c_master_xfer_one(adap, msg, stop); 228 + ret = uniphier_i2c_xfer_one(adap, msg, stop); 228 229 if (ret) 229 230 return ret; 230 231 } ··· 238 239 } 239 240 240 241 static const struct i2c_algorithm uniphier_i2c_algo = { 241 - .master_xfer = uniphier_i2c_master_xfer, 242 + .xfer = uniphier_i2c_xfer, 242 243 .functionality = uniphier_i2c_functionality, 243 244 }; 244 245
+1 -1
drivers/i2c/busses/i2c-viai2c-common.c
··· 198 198 } 199 199 EXPORT_SYMBOL_GPL(viai2c_init); 200 200 201 - MODULE_DESCRIPTION("Via/Wondermedia/Zhaoxin I2C master-mode bus adapter"); 201 + MODULE_DESCRIPTION("Via/Wondermedia/Zhaoxin I2C controller core"); 202 202 MODULE_AUTHOR("Tony Prisk <linux@prisktech.co.nz>"); 203 203 MODULE_LICENSE("GPL");
+4 -4
drivers/i2c/busses/i2c-viai2c-wmt.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 2 /* 3 - * Wondermedia I2C Master Mode Driver 3 + * Wondermedia I2C Controller Driver 4 4 * 5 5 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz> 6 6 * ··· 35 35 } 36 36 37 37 static const struct i2c_algorithm wmt_i2c_algo = { 38 - .master_xfer = viai2c_xfer, 39 - .functionality = wmt_i2c_func, 38 + .xfer = viai2c_xfer, 39 + .functionality = wmt_i2c_func, 40 40 }; 41 41 42 42 static int wmt_i2c_reset_hardware(struct viai2c *i2c) ··· 178 178 179 179 module_platform_driver(wmt_i2c_driver); 180 180 181 - MODULE_DESCRIPTION("Wondermedia I2C master-mode bus adapter"); 181 + MODULE_DESCRIPTION("Wondermedia I2C controller driver"); 182 182 MODULE_AUTHOR("Tony Prisk <linux@prisktech.co.nz>"); 183 183 MODULE_LICENSE("GPL"); 184 184 MODULE_DEVICE_TABLE(of, wmt_i2c_dt_ids);
+6 -6
drivers/i2c/busses/i2c-viai2c-zhaoxin.c
··· 38 38 #define ZXI2C_GOLD_FSTP_400K 0x38 39 39 #define ZXI2C_GOLD_FSTP_1M 0x13 40 40 #define ZXI2C_GOLD_FSTP_3400K 0x37 41 - #define ZXI2C_HS_MASTER_CODE (0x08 << 8) 41 + #define ZXI2C_HS_CTRL_CODE (0x08 << 8) 42 42 43 43 #define ZXI2C_FIFO_SIZE 32 44 44 ··· 136 136 return 0; 137 137 } 138 138 139 - static int zxi2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) 139 + static int zxi2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) 140 140 { 141 141 u8 tmp; 142 142 int ret; ··· 194 194 } 195 195 196 196 static const struct i2c_algorithm zxi2c_algorithm = { 197 - .master_xfer = zxi2c_master_xfer, 198 - .functionality = zxi2c_func, 197 + .xfer = zxi2c_xfer, 198 + .functionality = zxi2c_func, 199 199 }; 200 200 201 201 static const struct i2c_adapter_quirks zxi2c_quirks = { ··· 250 250 251 251 i2c->tcr = params[1]; 252 252 priv->mcr = ioread16(i2c->base + VIAI2C_REG_MCR); 253 - /* for Hs-mode, use 0x80 as master code */ 253 + /* for Hs-mode, use 0x80 as controller code */ 254 254 if (params[0] == I2C_MAX_HIGH_SPEED_MODE_FREQ) 255 - priv->mcr |= ZXI2C_HS_MASTER_CODE; 255 + priv->mcr |= ZXI2C_HS_CTRL_CODE; 256 256 257 257 dev_info(i2c->dev, "speed mode is %s\n", i2c_freq_mode_string(params[0])); 258 258 }
+4 -6
drivers/i2c/busses/i2c-viperboard.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 2 /* 3 - * Nano River Technologies viperboard i2c master driver 3 + * Nano River Technologies viperboard i2c controller driver 4 4 * 5 5 * (C) 2012 by Lemonage GmbH 6 6 * Author: Lars Poeschel <poeschel@lemonage.de> ··· 273 273 (struct vprbrd_i2c_addr_msg *)vb->buf; 274 274 struct vprbrd_i2c_status *smsg = (struct vprbrd_i2c_status *)vb->buf; 275 275 276 - dev_dbg(&i2c->dev, "master xfer %d messages:\n", num); 277 - 278 276 for (i = 0 ; i < num ; i++) { 279 277 pmsg = &msgs[i]; 280 278 ··· 343 345 344 346 /* This is the actual algorithm we define */ 345 347 static const struct i2c_algorithm vprbrd_algorithm = { 346 - .master_xfer = vprbrd_i2c_xfer, 347 - .functionality = vprbrd_i2c_func, 348 + .xfer = vprbrd_i2c_xfer, 349 + .functionality = vprbrd_i2c_func, 348 350 }; 349 351 350 352 static const struct i2c_adapter_quirks vprbrd_quirks = { ··· 458 460 module_exit(vprbrd_i2c_exit); 459 461 460 462 MODULE_AUTHOR("Lars Poeschel <poeschel@lemonage.de>"); 461 - MODULE_DESCRIPTION("I2C master driver for Nano River Techs Viperboard"); 463 + MODULE_DESCRIPTION("I2C controller driver for Nano River Techs Viperboard"); 462 464 MODULE_LICENSE("GPL"); 463 465 MODULE_ALIAS("platform:viperboard-i2c");
+1 -1
drivers/i2c/busses/i2c-virtio.c
··· 183 183 } 184 184 185 185 static struct i2c_algorithm virtio_algorithm = { 186 - .master_xfer = virtio_i2c_xfer, 186 + .xfer = virtio_i2c_xfer, 187 187 .functionality = virtio_i2c_func, 188 188 }; 189 189
+5 -4
drivers/i2c/busses/i2c-xiic.c
··· 1105 1105 mutex_lock(&i2c->lock); 1106 1106 1107 1107 ret = xiic_busy(i2c); 1108 - if (ret) 1108 + if (ret) { 1109 + dev_err(i2c->adap.dev.parent, 1110 + "cannot start a transfer while busy\n"); 1109 1111 goto out; 1112 + } 1110 1113 1111 1114 i2c->tx_msg = msgs; 1112 1115 i2c->rx_msg = NULL; ··· 1167 1164 return err; 1168 1165 1169 1166 err = xiic_start_xfer(i2c, msgs, num); 1170 - if (err < 0) { 1171 - dev_err(adap->dev.parent, "Error xiic_start_xfer\n"); 1167 + if (err < 0) 1172 1168 goto out; 1173 - } 1174 1169 1175 1170 err = wait_for_completion_timeout(&i2c->completion, XIIC_XFER_TIMEOUT); 1176 1171 mutex_lock(&i2c->lock);
+4 -2
drivers/i2c/i2c-core-base.c
··· 1066 1066 1067 1067 1068 1068 static const struct i2c_device_id dummy_id[] = { 1069 - { "dummy", 0 }, 1070 - { "smbus_host_notify", 0 }, 1069 + { "dummy", }, 1070 + { "smbus_host_notify", }, 1071 1071 { }, 1072 1072 }; 1073 1073 ··· 1468 1468 1469 1469 if (!adap) 1470 1470 return -EINVAL; 1471 + 1472 + dev_dbg(&adap->dev, "Detected HostNotify from address 0x%02x", addr); 1471 1473 1472 1474 irq = irq_find_mapping(adap->host_notify_domain, addr); 1473 1475 if (irq <= 0)
+12
drivers/i2c/i2c-dev.c
··· 139 139 140 140 struct i2c_client *client = file->private_data; 141 141 142 + /* Adapter must support I2C transfers */ 143 + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) 144 + return -EOPNOTSUPP; 145 + 142 146 if (count > 8192) 143 147 count = 8192; 144 148 ··· 166 162 int ret; 167 163 char *tmp; 168 164 struct i2c_client *client = file->private_data; 165 + 166 + /* Adapter must support I2C transfers */ 167 + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) 168 + return -EOPNOTSUPP; 169 169 170 170 if (count > 8192) 171 171 count = 8192; ··· 245 237 { 246 238 u8 __user **data_ptrs; 247 239 int i, res; 240 + 241 + /* Adapter must support I2C transfers */ 242 + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) 243 + return -EOPNOTSUPP; 248 244 249 245 data_ptrs = kmalloc_array(nmsgs, sizeof(u8 __user *), GFP_KERNEL); 250 246 if (data_ptrs == NULL) {
+1 -1
drivers/i2c/i2c-slave-testunit.c
··· 172 172 } 173 173 174 174 static const struct i2c_device_id i2c_slave_testunit_id[] = { 175 - { "slave-testunit", 0 }, 175 + { "slave-testunit" }, 176 176 { } 177 177 }; 178 178 MODULE_DEVICE_TABLE(i2c, i2c_slave_testunit_id);
+1 -1
drivers/i2c/i2c-smbus.c
··· 160 160 } 161 161 162 162 static const struct i2c_device_id smbalert_ids[] = { 163 - { "smbus_alert", 0 }, 163 + { "smbus_alert" }, 164 164 { /* LIST END */ } 165 165 }; 166 166 MODULE_DEVICE_TABLE(i2c, smbalert_ids);
+1 -1
drivers/i2c/muxes/i2c-mux-pca9541.c
··· 78 78 }; 79 79 80 80 static const struct i2c_device_id pca9541_id[] = { 81 - {"pca9541", 0}, 81 + { "pca9541" }, 82 82 {} 83 83 }; 84 84
+8
drivers/misc/eeprom/at24.c
··· 174 174 AT24_FLAG_MAC | AT24_FLAG_READONLY); 175 175 AT24_CHIP_DATA(at24_data_24mac602, 64 / 8, 176 176 AT24_FLAG_MAC | AT24_FLAG_READONLY); 177 + AT24_CHIP_DATA(at24_data_24aa025e48, 48 / 8, 178 + AT24_FLAG_READONLY); 179 + AT24_CHIP_DATA(at24_data_24aa025e64, 64 / 8, 180 + AT24_FLAG_READONLY); 177 181 /* spd is a 24c02 in memory DIMMs */ 178 182 AT24_CHIP_DATA(at24_data_spd, 2048 / 8, 179 183 AT24_FLAG_READONLY | AT24_FLAG_IRUGO); ··· 222 218 { "24cs02", (kernel_ulong_t)&at24_data_24cs02 }, 223 219 { "24mac402", (kernel_ulong_t)&at24_data_24mac402 }, 224 220 { "24mac602", (kernel_ulong_t)&at24_data_24mac602 }, 221 + { "24aa025e48", (kernel_ulong_t)&at24_data_24aa025e48 }, 222 + { "24aa025e64", (kernel_ulong_t)&at24_data_24aa025e64 }, 225 223 { "spd", (kernel_ulong_t)&at24_data_spd }, 226 224 { "24c02-vaio", (kernel_ulong_t)&at24_data_24c02_vaio }, 227 225 { "24c04", (kernel_ulong_t)&at24_data_24c04 }, ··· 276 270 { .compatible = "atmel,24c1024", .data = &at24_data_24c1024 }, 277 271 { .compatible = "atmel,24c1025", .data = &at24_data_24c1025 }, 278 272 { .compatible = "atmel,24c2048", .data = &at24_data_24c2048 }, 273 + { .compatible = "microchip,24aa025e48", .data = &at24_data_24aa025e48 }, 274 + { .compatible = "microchip,24aa025e64", .data = &at24_data_24aa025e64 }, 279 275 { /* END OF LIST */ }, 280 276 }; 281 277 MODULE_DEVICE_TABLE(of, at24_of_match);
+32 -12
include/linux/i2c.h
··· 513 513 514 514 /** 515 515 * struct i2c_algorithm - represent I2C transfer method 516 - * @master_xfer: Issue a set of i2c transactions to the given I2C adapter 516 + * @xfer: Issue a set of i2c transactions to the given I2C adapter 517 517 * defined by the msgs array, with num messages available to transfer via 518 518 * the adapter specified by adap. 519 - * @master_xfer_atomic: same as @master_xfer. Yet, only using atomic context 519 + * @xfer_atomic: same as @xfer. Yet, only using atomic context 520 520 * so e.g. PMICs can be accessed very late before shutdown. Optional. 521 521 * @smbus_xfer: Issue smbus transactions to the given I2C adapter. If this 522 522 * is not present, then the bus layer will try and convert the SMBus calls ··· 525 525 * so e.g. PMICs can be accessed very late before shutdown. Optional. 526 526 * @functionality: Return the flags that this algorithm/adapter pair supports 527 527 * from the ``I2C_FUNC_*`` flags. 528 - * @reg_slave: Register given client to I2C slave mode of this adapter 529 - * @unreg_slave: Unregister given client from I2C slave mode of this adapter 528 + * @reg_target: Register given client to local target mode of this adapter 529 + * @unreg_target: Unregister given client from local target mode of this adapter 530 + * 531 + * @master_xfer: deprecated, use @xfer 532 + * @master_xfer_atomic: deprecated, use @xfer_atomic 533 + * @reg_slave: deprecated, use @reg_target 534 + * @unreg_slave: deprecated, use @unreg_target 535 + * 530 536 * 531 537 * The following structs are for those who like to implement new bus drivers: 532 538 * i2c_algorithm is the interface to a class of hardware solutions which can 533 539 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 534 540 * to name two of the most common. 535 541 * 536 - * The return codes from the ``master_xfer{_atomic}`` fields should indicate the 542 + * The return codes from the ``xfer{_atomic}`` fields should indicate the 537 543 * type of error code that occurred during the transfer, as documented in the 538 544 * Kernel Documentation file Documentation/i2c/fault-codes.rst. Otherwise, the 539 545 * number of messages executed should be returned. 540 546 */ 541 547 struct i2c_algorithm { 542 548 /* 543 - * If an adapter algorithm can't do I2C-level access, set master_xfer 549 + * If an adapter algorithm can't do I2C-level access, set xfer 544 550 * to NULL. If an adapter algorithm can do SMBus access, set 545 551 * smbus_xfer. If set to NULL, the SMBus protocol is simulated 546 552 * using common I2C messages. 547 553 * 548 - * master_xfer should return the number of messages successfully 554 + * xfer should return the number of messages successfully 549 555 * processed, or a negative value on error 550 556 */ 551 - int (*master_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs, 552 - int num); 553 - int (*master_xfer_atomic)(struct i2c_adapter *adap, 557 + union { 558 + int (*xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs, 559 + int num); 560 + int (*master_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs, 561 + int num); 562 + }; 563 + union { 564 + int (*xfer_atomic)(struct i2c_adapter *adap, 554 565 struct i2c_msg *msgs, int num); 566 + int (*master_xfer_atomic)(struct i2c_adapter *adap, 567 + struct i2c_msg *msgs, int num); 568 + }; 555 569 int (*smbus_xfer)(struct i2c_adapter *adap, u16 addr, 556 570 unsigned short flags, char read_write, 557 571 u8 command, int size, union i2c_smbus_data *data); ··· 577 563 u32 (*functionality)(struct i2c_adapter *adap); 578 564 579 565 #if IS_ENABLED(CONFIG_I2C_SLAVE) 580 - int (*reg_slave)(struct i2c_client *client); 581 - int (*unreg_slave)(struct i2c_client *client); 566 + union { 567 + int (*reg_target)(struct i2c_client *client); 568 + int (*reg_slave)(struct i2c_client *client); 569 + }; 570 + union { 571 + int (*unreg_target)(struct i2c_client *client); 572 + int (*unreg_slave)(struct i2c_client *client); 573 + }; 582 574 #endif 583 575 }; 584 576