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.11-rc1-second-batch' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull more i2c updates from Wolfram Sang:
"The I2C core has two header documentation updates as the dependecies
are in now.

The I2C host drivers add some patches which nearly fell through the
cracks:

- Added descriptions in the DTS for the Qualcomm SM8650 and SM8550
Camera Control Interface (CCI).

- Added support for the "settle-time-us" property, which allows the
gpio-mux device to switch from one bus to another with a
configurable delay. The time can be set in the DTS. The latest
change also includes file sorting.

- Fixed slot numbering in the SMBus framework to prevent failures
when more than 8 slots are occupied. It now enforces a a maximum of
8 slots to be used. This ensures that the Intel PIIX4 device can
register the SPDs correctly without failure, even if other slots
are populated but not used"

* tag 'i2c-for-6.11-rc1-second-batch' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: header: improve kdoc for i2c_algorithm
i2c: header: remove unneeded stuff regarding i2c_algorithm
i2c: piix4: Register SPDs
i2c: smbus: remove i801 assumptions from SPD probing
i2c: mux: gpio: Add support for the 'settle-time-us' property
i2c: mux: gpio: Re-order #include to match alphabetic order
dt-bindings: i2c: mux-gpio: Add 'settle-time-us' property
dt-bindings: i2c: qcom-cci: Document sm8650 compatible
dt-bindings: i2c: qcom-cci: Document sm8550 compatible

+56 -29
+3
Documentation/devicetree/bindings/i2c/i2c-mux-gpio.yaml
··· 57 57 last value used. 58 58 $ref: /schemas/types.yaml#/definitions/uint32 59 59 60 + settle-time-us: 61 + description: Delay to wait before doing any transfer when a new bus gets selected. 62 + 60 63 allOf: 61 64 - $ref: i2c-mux.yaml 62 65
+20
Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
··· 31 31 - qcom,sm6350-cci 32 32 - qcom,sm8250-cci 33 33 - qcom,sm8450-cci 34 + - qcom,sm8550-cci 35 + - qcom,sm8650-cci 34 36 - const: qcom,msm8996-cci # CCI v2 35 37 36 38 "#address-cells": ··· 194 192 items: 195 193 - const: camnoc_axi 196 194 - const: slow_ahb_src 195 + - const: cpas_ahb 196 + - const: cci 197 + 198 + - if: 199 + properties: 200 + compatible: 201 + contains: 202 + enum: 203 + - qcom,sm8550-cci 204 + - qcom,sm8650-cci 205 + then: 206 + properties: 207 + clocks: 208 + minItems: 3 209 + maxItems: 3 210 + clock-names: 211 + items: 212 + - const: camnoc_axi 197 213 - const: cpas_ahb 198 214 - const: cci 199 215
+1
drivers/i2c/busses/Kconfig
··· 196 196 config I2C_PIIX4 197 197 tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)" 198 198 depends on PCI && HAS_IOPORT 199 + select I2C_SMBUS 199 200 help 200 201 If you say yes to this option, support will be included for the Intel 201 202 PIIX4 family of mainboard I2C interfaces. Specifically, the following
+9
drivers/i2c/busses/i2c-piix4.c
··· 29 29 #include <linux/stddef.h> 30 30 #include <linux/ioport.h> 31 31 #include <linux/i2c.h> 32 + #include <linux/i2c-smbus.h> 32 33 #include <linux/slab.h> 33 34 #include <linux/dmi.h> 34 35 #include <linux/acpi.h> ··· 982 981 release_region(smba, SMBIOSIZE); 983 982 return retval; 984 983 } 984 + 985 + /* 986 + * The AUX bus can not be probed as on some platforms it reports all 987 + * devices present and all reads return "0". 988 + * This would allow the ee1004 to be probed incorrectly. 989 + */ 990 + if (port == 0) 991 + i2c_register_spd(adap); 985 992 986 993 *padap = adap; 987 994 return 0;
+4 -11
drivers/i2c/i2c-smbus.c
··· 352 352 return; 353 353 354 354 /* 355 - * If we're a child adapter on a muxed segment, then limit slots to 8, 356 - * as this is the max number of SPD EEPROMs that can be addressed per bus. 355 + * The max number of SPD EEPROMs that can be addressed per bus is 8. 356 + * If more slots are present either muxed or multiple busses are 357 + * necessary or the additional slots are ignored. 357 358 */ 358 - if (i2c_parent_is_i2c_adapter(adap)) { 359 - slot_count = 8; 360 - } else { 361 - if (slot_count > 8) { 362 - dev_warn(&adap->dev, 363 - "More than 8 memory slots on a single bus, contact i801 maintainer to add missing mux config\n"); 364 - return; 365 - } 366 - } 359 + slot_count = min(slot_count, 8); 367 360 368 361 /* 369 362 * Memory types could be found at section 7.18.2 (Memory Device — Type), table 78
+10 -4
drivers/i2c/muxes/i2c-mux-gpio.c
··· 5 5 * Peter Korsgaard <peter.korsgaard@barco.com> 6 6 */ 7 7 8 + #include <linux/bits.h> 9 + #include <linux/delay.h> 10 + #include <linux/gpio/consumer.h> 11 + #include <linux/gpio/driver.h> 8 12 #include <linux/i2c.h> 9 13 #include <linux/i2c-mux.h> 14 + #include <linux/module.h> 10 15 #include <linux/overflow.h> 11 16 #include <linux/platform_data/i2c-mux-gpio.h> 12 17 #include <linux/platform_device.h> 13 - #include <linux/module.h> 14 18 #include <linux/slab.h> 15 - #include <linux/bits.h> 16 - #include <linux/gpio/consumer.h> 17 - #include <linux/gpio/driver.h> 18 19 19 20 struct gpiomux { 20 21 struct i2c_mux_gpio_platform_data data; ··· 37 36 struct gpiomux *mux = i2c_mux_priv(muxc); 38 37 39 38 i2c_mux_gpio_set(mux, chan); 39 + 40 + if (mux->data.settle_time) 41 + fsleep(mux->data.settle_time); 40 42 41 43 return 0; 42 44 } ··· 119 115 120 116 if (device_property_read_u32(dev, "idle-state", &mux->data.idle)) 121 117 mux->data.idle = I2C_MUX_GPIO_NO_IDLE; 118 + 119 + device_property_read_u32(dev, "settle-time-us", &mux->data.settle_time); 122 120 123 121 return 0; 124 122 }
+7 -14
include/linux/i2c.h
··· 30 30 /* --- General options ------------------------------------------------ */ 31 31 32 32 struct i2c_msg; 33 - struct i2c_algorithm; 34 33 struct i2c_adapter; 35 34 struct i2c_client; 36 35 struct i2c_driver; ··· 511 512 #endif /* I2C_BOARDINFO */ 512 513 513 514 /** 514 - * struct i2c_algorithm - represent I2C transfer method 515 - * @xfer: Issue a set of i2c transactions to the given I2C adapter 516 - * defined by the msgs array, with num messages available to transfer via 517 - * the adapter specified by adap. 518 - * @xfer_atomic: same as @xfer. Yet, only using atomic context 519 - * so e.g. PMICs can be accessed very late before shutdown. Optional. 520 - * @smbus_xfer: Issue smbus transactions to the given I2C adapter. If this 515 + * struct i2c_algorithm - represent I2C transfer methods 516 + * @xfer: Transfer a given number of messages defined by the msgs array via 517 + * the specified adapter. 518 + * @xfer_atomic: Same as @xfer. Yet, only using atomic context so e.g. PMICs 519 + * can be accessed very late before shutdown. Optional. 520 + * @smbus_xfer: Issue SMBus transactions to the given I2C adapter. If this 521 521 * is not present, then the bus layer will try and convert the SMBus calls 522 522 * into I2C transfers instead. 523 - * @smbus_xfer_atomic: same as @smbus_xfer. Yet, only using atomic context 523 + * @smbus_xfer_atomic: Same as @smbus_xfer. Yet, only using atomic context 524 524 * so e.g. PMICs can be accessed very late before shutdown. Optional. 525 525 * @functionality: Return the flags that this algorithm/adapter pair supports 526 526 * from the ``I2C_FUNC_*`` flags. ··· 531 533 * @reg_slave: deprecated, use @reg_target 532 534 * @unreg_slave: deprecated, use @unreg_target 533 535 * 534 - * 535 - * The following structs are for those who like to implement new bus drivers: 536 536 * i2c_algorithm is the interface to a class of hardware solutions which can 537 537 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 538 538 * to name two of the most common. ··· 546 550 * to NULL. If an adapter algorithm can do SMBus access, set 547 551 * smbus_xfer. If set to NULL, the SMBus protocol is simulated 548 552 * using common I2C messages. 549 - * 550 - * xfer should return the number of messages successfully 551 - * processed, or a negative value on error 552 553 */ 553 554 union { 554 555 int (*xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs,
+2
include/linux/platform_data/i2c-mux-gpio.h
··· 19 19 * position 20 20 * @n_values: Number of multiplexer positions (busses to instantiate) 21 21 * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used 22 + * @settle_time: Delay to wait when a new bus is selected 22 23 */ 23 24 struct i2c_mux_gpio_platform_data { 24 25 int parent; ··· 27 26 const unsigned *values; 28 27 int n_values; 29 28 unsigned idle; 29 + u32 settle_time; 30 30 }; 31 31 32 32 #endif /* _LINUX_I2C_MUX_GPIO_H */