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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'i2c-for-6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
"The core gains placeholders for recently added functions when
CONFIG_I2C is not defined as well documentation fixes to start using
inclusive terminology.

The drivers get paths in DT bindings fixed as well as proper interrupt
handling for the ocores driver"

* tag 'i2c-for-6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
docs: i2c: summary: be clearer with 'controller/target' and 'adapter/client' pairs
docs: i2c: summary: document 'local' and 'remote' targets
docs: i2c: summary: document use of inclusive language
docs: i2c: summary: update speed mode description
docs: i2c: summary: update I2C specification link
docs: i2c: summary: start sentences consistently.
i2c: Add nop fwnode operations
i2c: ocores: set IACK bit after core is enabled
dt-bindings: i2c: google,cros-ec-i2c-tunnel: correct path to i2c-controller schema
dt-bindings: i2c: atmel,at91sam: correct path to i2c-controller schema

+83 -41
+1 -1
Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
··· 77 77 - clocks 78 78 79 79 allOf: 80 - - $ref: i2c-controller.yaml 80 + - $ref: /schemas/i2c/i2c-controller.yaml# 81 81 - if: 82 82 properties: 83 83 compatible:
+1 -1
Documentation/devicetree/bindings/i2c/google,cros-ec-i2c-tunnel.yaml
··· 21 21 google,cros-ec-spi or google,cros-ec-i2c. 22 22 23 23 allOf: 24 - - $ref: i2c-controller.yaml# 24 + - $ref: /schemas/i2c/i2c-controller.yaml# 25 25 26 26 properties: 27 27 compatible:
+8 -7
Documentation/i2c/i2c_bus.svg
··· 1 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 2 2 <!-- Created with Inkscape (http://www.inkscape.org/) --> 3 + <!-- Updated to inclusive terminology by Wolfram Sang --> 3 4 4 5 <svg 5 6 xmlns:dc="http://purl.org/dc/elements/1.1/" ··· 1121 1120 <rect 1122 1121 style="opacity:1;fill:#ffb9b9;fill-opacity:1;stroke:#f00000;stroke-width:2.8125;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" 1123 1122 id="rect4424-3-2-9-7" 1124 - width="112.5" 1123 + width="134.5" 1125 1124 height="113.75008" 1126 1125 x="112.5" 1127 1126 y="471.11221" ··· 1134 1133 y="521.46259" 1135 1134 id="text4349"><tspan 1136 1135 sodipodi:role="line" 1137 - x="167.5354" 1136 + x="178.5354" 1138 1137 y="521.46259" 1139 1138 style="font-size:25px;line-height:1.25;font-family:sans-serif;text-align:center;text-anchor:middle" 1140 1139 id="tspan1273">I2C</tspan><tspan 1141 1140 sodipodi:role="line" 1142 - x="167.5354" 1141 + x="178.5354" 1143 1142 y="552.71259" 1144 1143 style="font-size:25px;line-height:1.25;font-family:sans-serif;text-align:center;text-anchor:middle" 1145 - id="tspan1285">Master</tspan></text> 1144 + id="tspan1285">Controller</tspan></text> 1146 1145 <rect 1147 1146 style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#b9ffb9;fill-opacity:1;fill-rule:nonzero;stroke:#006400;stroke-width:2.8125;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" 1148 1147 id="rect4424-3-2-9-7-3-3-5-3" ··· 1172 1171 x="318.59131" 1173 1172 y="552.08752" 1174 1173 style="font-size:25.00000191px;line-height:1.25;font-family:sans-serif;text-align:center;text-anchor:middle;stroke-width:1px" 1175 - id="tspan1287">Slave</tspan></text> 1174 + id="tspan1287">Target</tspan></text> 1176 1175 <path 1177 1176 style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.99968767;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" 1178 1177 d="m 112.49995,677.36223 c 712.50005,0 712.50005,0 712.50005,0" ··· 1234 1233 x="468.59131" 1235 1234 y="552.08746" 1236 1235 style="font-size:25.00000191px;line-height:1.25;font-family:sans-serif;text-align:center;text-anchor:middle;stroke-width:1px" 1237 - id="tspan1287-6">Slave</tspan></text> 1236 + id="tspan1287-6">Target</tspan></text> 1238 1237 <rect 1239 1238 style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#b9ffb9;fill-opacity:1;fill-rule:nonzero;stroke:#006400;stroke-width:2.8125;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" 1240 1239 id="rect4424-3-2-9-7-3-3-5-3-1" ··· 1259 1258 x="618.59131" 1260 1259 y="552.08746" 1261 1260 style="font-size:25.00000191px;line-height:1.25;font-family:sans-serif;text-align:center;text-anchor:middle;stroke-width:1px" 1262 - id="tspan1287-9">Slave</tspan></text> 1261 + id="tspan1287-9">Target</tspan></text> 1263 1262 <path 1264 1263 style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.99968743;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#DotM)" 1265 1264 d="m 150,583.61221 v 93.75"
+50 -29
Documentation/i2c/summary.rst
··· 3 3 ============================= 4 4 5 5 I²C (pronounce: I squared C and written I2C in the kernel documentation) is 6 - a protocol developed by Philips. It is a slow two-wire protocol (variable 7 - speed, up to 400 kHz), with a high speed extension (3.4 MHz). It provides 6 + a protocol developed by Philips. It is a two-wire protocol with variable 7 + speed (typically up to 400 kHz, high speed modes up to 5 MHz). It provides 8 8 an inexpensive bus for connecting many types of devices with infrequent or 9 - low bandwidth communications needs. I2C is widely used with embedded 10 - systems. Some systems use variants that don't meet branding requirements, 9 + low bandwidth communications needs. I2C is widely used with embedded 10 + systems. Some systems use variants that don't meet branding requirements, 11 11 and so are not advertised as being I2C but come under different names, 12 12 e.g. TWI (Two Wire Interface), IIC. 13 13 14 - The latest official I2C specification is the `"I2C-bus specification and user 15 - manual" (UM10204) <https://www.nxp.com/webapp/Download?colCode=UM10204>`_ 16 - published by NXP Semiconductors. However, you need to log-in to the site to 17 - access the PDF. An older version of the specification (revision 6) is archived 18 - `here <https://web.archive.org/web/20210813122132/https://www.nxp.com/docs/en/user-guide/UM10204.pdf>`_. 14 + The latest official I2C specification is the `"I²C-bus specification and user 15 + manual" (UM10204) <https://www.nxp.com/docs/en/user-guide/UM10204.pdf>`_ 16 + published by NXP Semiconductors, version 7 as of this writing. 19 17 20 18 SMBus (System Management Bus) is based on the I2C protocol, and is mostly 21 - a subset of I2C protocols and signaling. Many I2C devices will work on an 19 + a subset of I2C protocols and signaling. Many I2C devices will work on an 22 20 SMBus, but some SMBus protocols add semantics beyond what is required to 23 - achieve I2C branding. Modern PC mainboards rely on SMBus. The most common 21 + achieve I2C branding. Modern PC mainboards rely on SMBus. The most common 24 22 devices connected through SMBus are RAM modules configured using I2C EEPROMs, 25 23 and hardware monitoring chips. 26 24 27 25 Because the SMBus is mostly a subset of the generalized I2C bus, we can 28 - use its protocols on many I2C systems. However, there are systems that don't 26 + use its protocols on many I2C systems. However, there are systems that don't 29 27 meet both SMBus and I2C electrical constraints; and others which can't 30 28 implement all the common SMBus protocol semantics or messages. 31 29 ··· 31 33 Terminology 32 34 =========== 33 35 34 - Using the terminology from the official documentation, the I2C bus connects 35 - one or more *master* chips and one or more *slave* chips. 36 + The I2C bus connects one or more controller chips and one or more target chips. 36 37 37 38 .. kernel-figure:: i2c_bus.svg 38 - :alt: Simple I2C bus with one master and 3 slaves 39 + :alt: Simple I2C bus with one controller and 3 targets 39 40 40 41 Simple I2C bus 41 42 42 - A **master** chip is a node that starts communications with slaves. In the 43 - Linux kernel implementation it is called an **adapter** or bus. Adapter 44 - drivers are in the ``drivers/i2c/busses/`` subdirectory. 43 + A **controller** chip is a node that starts communications with targets. In the 44 + Linux kernel implementation it is also called an "adapter" or "bus". Controller 45 + drivers are usually in the ``drivers/i2c/busses/`` subdirectory. 45 46 46 - An **algorithm** contains general code that can be used to implement a 47 - whole class of I2C adapters. Each specific adapter driver either depends on 48 - an algorithm driver in the ``drivers/i2c/algos/`` subdirectory, or includes 49 - its own implementation. 47 + An **algorithm** contains general code that can be used to implement a whole 48 + class of I2C controllers. Each specific controller driver either depends on an 49 + algorithm driver in the ``drivers/i2c/algos/`` subdirectory, or includes its 50 + own implementation. 50 51 51 - A **slave** chip is a node that responds to communications when addressed 52 - by the master. In Linux it is called a **client**. Client drivers are kept 53 - in a directory specific to the feature they provide, for example 54 - ``drivers/media/gpio/`` for GPIO expanders and ``drivers/media/i2c/`` for 52 + A **target** chip is a node that responds to communications when addressed by a 53 + controller. In the Linux kernel implementation it is also called a "client". 54 + While targets are usually separate external chips, Linux can also act as a 55 + target (needs hardware support) and respond to another controller on the bus. 56 + This is then called a **local target**. In contrast, an external chip is called 57 + a **remote target**. 58 + 59 + Target drivers are kept in a directory specific to the feature they provide, 60 + for example ``drivers/gpio/`` for GPIO expanders and ``drivers/media/i2c/`` for 55 61 video-related chips. 56 62 57 - For the example configuration in figure, you will need a driver for your 58 - I2C adapter, and drivers for your I2C devices (usually one driver for each 59 - device). 63 + For the example configuration in the figure above, you will need one driver for 64 + the I2C controller, and drivers for your I2C targets. Usually one driver for 65 + each target. 66 + 67 + Synonyms 68 + -------- 69 + 70 + As mentioned above, the Linux I2C implementation historically uses the terms 71 + "adapter" for controller and "client" for target. A number of data structures 72 + have these synonyms in their name. So, when discussing implementation details, 73 + you should be aware of these terms as well. The official wording is preferred, 74 + though. 75 + 76 + Outdated terminology 77 + -------------------- 78 + 79 + In earlier I2C specifications, controller was named "master" and target was 80 + named "slave". These terms have been obsoleted with v7 of the specification and 81 + their use is also discouraged by the Linux Kernel Code of Conduct. You may 82 + still find them in references to documentation which has not been updated. The 83 + general attitude, however, is to use the inclusive terms: controller and 84 + target. Work to replace the old terminology in the Linux Kernel is on-going.
+1 -1
drivers/i2c/busses/i2c-ocores.c
··· 431 431 oc_setreg(i2c, OCI2C_PREHIGH, prescale >> 8); 432 432 433 433 /* Init the device */ 434 - oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK); 435 434 oc_setreg(i2c, OCI2C_CONTROL, ctrl | OCI2C_CTRL_EN); 435 + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK); 436 436 437 437 return 0; 438 438 }
+22 -2
include/linux/i2c.h
··· 960 960 #define builtin_i2c_driver(__i2c_driver) \ 961 961 builtin_driver(__i2c_driver, i2c_add_driver) 962 962 963 - #endif /* I2C */ 964 - 965 963 /* must call put_device() when done with returned i2c_client device */ 966 964 struct i2c_client *i2c_find_device_by_fwnode(struct fwnode_handle *fwnode); 967 965 ··· 968 970 969 971 /* must call i2c_put_adapter() when done with returned i2c_adapter device */ 970 972 struct i2c_adapter *i2c_get_adapter_by_fwnode(struct fwnode_handle *fwnode); 973 + 974 + #else /* I2C */ 975 + 976 + static inline struct i2c_client * 977 + i2c_find_device_by_fwnode(struct fwnode_handle *fwnode) 978 + { 979 + return NULL; 980 + } 981 + 982 + static inline struct i2c_adapter * 983 + i2c_find_adapter_by_fwnode(struct fwnode_handle *fwnode) 984 + { 985 + return NULL; 986 + } 987 + 988 + static inline struct i2c_adapter * 989 + i2c_get_adapter_by_fwnode(struct fwnode_handle *fwnode) 990 + { 991 + return NULL; 992 + } 993 + 994 + #endif /* !I2C */ 971 995 972 996 #if IS_ENABLED(CONFIG_OF) 973 997 /* must call put_device() when done with returned i2c_client device */