aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-05-06i2c: qcom-geni: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-3/+4
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Fix to the proper variable type 'unsigned long' while here. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Reviewed-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: jz4780: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-11/+11
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Fix to the proper variable type 'unsigned long' while here. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Paul Cercueil <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: synquacer: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-4/+4
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: stm32f7: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-4/+4
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: stm32f4: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-4/+4
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: st: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-4/+4
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: omap: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-5/+5
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: imx-lpi2c: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-3/+3
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: hix5hd2: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-4/+4
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: exynos5: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-6/+6
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: digicolor: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-3/+3
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Baruch Siach <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: amd-mp2-plat: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-4/+4
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: ali15x3: remove printout on handled timeoutsWolfram Sang1-3/+1
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: ali1563: remove printout on handled timeoutsWolfram Sang1-1/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: ali1535: remove printout on handled timeoutsWolfram Sang1-6/+2
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: i801: remove printout on handled timeoutsWolfram Sang1-3/+1
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout and turn the SMBus-specific termination message to debug. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: add zhaoxin i2c controller driverHans Hu6-5/+353
Add Zhaoxin I2C controller driver. It provides the access to the i2c busses, which connects to the touchpad, eeprom, I2S, etc. Zhaoxin I2C controller has two separate busses, so may accommodate up to two I2C adapters. Those adapters are listed in the ACPI namespace with the IIC1D17 HID, and probed by a platform driver. The driver works with IRQ mode, and supports basic I2C features. Flags I2C_AQ_NO_ZERO_LEN and I2C_AQ_COMB_WRITE_THEN_READ are used to limit the unsupported access. Acked-by: Wolfram Sang <[email protected]> Signed-off-by: Hans Hu <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: wmt: add platform type VIAI2C_PLAT_WMTHans Hu3-14/+27
Enumeration variables are added to differentiate between different platforms. Acked-by: Wolfram Sang <[email protected]> Signed-off-by: Hans Hu <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: wmt: fix a bug when thread blockedHans Hu2-71/+80
During each byte access, the host performs clock stretching. To reduce the host performs clock stretching, move most of the per-msg processing to the interrupt context. Suggested-by: Wolfram Sang <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Hans Hu <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: wmt: rename somethingHans Hu3-146/+143
1. The I2C IP for both wmt and zhaoxin originates from VIA. Rename common registers, functions, and variable names to follow the VIAI2C_ and viai2c_ naming conventions for consistency and clarity. 2. rename i2c_dev to i2c, to shorten the length of a line. 3. rename wait_result to time_left, make it better to reflect the meaning of the value returned by wait_for_completion_timeout(). 4. remove TCR_MASTER_WRITE, its value is 0. Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Hans Hu <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: wmt: split out common filesHans Hu6-431/+442
Since the I2C IP of both wmt and zhaoxin originates from VIA, it is better to separate the common code first. The common driver is named as i2c-viai2c-common.c. Old i2c-wmt.c renamed to i2c-viai2c-wmt.c. The MAINTAINERS file will be updated accordingly in upcoming commits. Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Hans Hu <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: wmt: create wmt_i2c_init for general initHans Hu1-28/+37
Some common initialization actions are put in the function wmt_i2c_init(), which is convenient to share with zhaoxin. Reviewed-by: Andi Shyti <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Hans Hu <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: thunderx: Adding ioclk supportPiyush Malgujar1-2/+3
Read the ioclk property as reference clock if sclk not present in acpi table to make it SOC agnostic. In case, it's not populated from dts/acpi table, use the default clock of 800 MHz which is optimal in either case of sclk/ioclk. Signed-off-by: Piyush Malgujar <[email protected]> Acked-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: octeon: Handle watchdog timeoutSuneel Garapati2-0/+12
Add watchdog timeout handling to cater to the unhandled warnings seen during validation on boards with different I2C slaves. This status code reflects the state that controller couldn't receive any response from slave while being in non-idle state and HW recommends to reset before any further bus access. Signed-off-by: Suneel Garapati <[email protected]> Signed-off-by: Piyush Malgujar <[email protected]> Acked-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: octeon: Add platform prefix to macrosPiyush Malgujar2-31/+31
The macros for TWSI register's offset are generically named, rename them to be platform specific macros by adding 'OCTEON_REG' as prefix. Signed-off-by: Piyush Malgujar <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: thunderx: Support for High speed modeSuneel Garapati3-25/+54
To support bus operations for high speed bus frequencies greater than 400KHZ following control bits need to be setup accordingly - hs_mode (bit 0) field in Mode register to switch controller between low-speed and high-speed frequency operating mode. - Setup clock divisors for desired TWSI bus frequency using FOSCL output frequency divisor (D): 0 - sets the divisor to 10 for low speed mode 1 - sets the divisor to 15 for high speed mode. The TWSI bus output frequency, in master mode is based on: TCLK = 100MHz / (THP + 2) FOSCL = FSAMP / (M+1)×D = TCLK / (2 ^ N × (M + 1) × 15) FSAMP = TCLK / 2 ^ N where, N is <2:0> and M is <6:3> of TWSI Clock Control Register D is 10 for low speed or 15 for HS_MODE With high speed mode support, HLC mode usage is limited to low speed frequency (<=400KHz) bus transfers in hardware. Signed-off-by: Suneel Garapati <[email protected]> Signed-off-by: Piyush Malgujar <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: thunderx: Clock divisor logic changesSuneel Garapati3-4/+59
Handle changes to clock divisor logic for OcteonTX2 SoC family using subsystem ID and using default reference clock source as 100MHz. Signed-off-by: Suneel Garapati <[email protected]> Signed-off-by: Piyush Malgujar <[email protected]> Acked-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: cadence: Add RISCV architecture supportJi Sheng Teoh1-1/+1
Add RISCV support to Cadence I2C Kconfig which is used in platform such as the StarFive JH8100. Signed-off-by: Eng Lee Teh <[email protected]> Signed-off-by: Ji Sheng Teoh <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: uniphier: remove printout on handled timeoutsWolfram Sang1-3/+1
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: uniphier-f: remove printout on handled timeoutsWolfram Sang1-1/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: tegra: remove printout on handled timeoutsWolfram Sang1-2/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: st: remove printout on handled timeoutsWolfram Sang1-4/+1
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: sh_mobile: remove printout on handled timeoutsWolfram Sang1-1/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: rk3x: remove printout on handled timeoutsWolfram Sang1-3/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Heiko Stuebner <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: qup: remove printout on handled timeoutsWolfram Sang1-3/+1
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: qcom-geni: remove printout on handled timeoutsWolfram Sang1-4/+1
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: omap: remove printout on handled timeoutsWolfram Sang1-1/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: nomadik: remove printout on handled timeoutsWolfram Sang1-5/+2
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: ismt: remove printout on handled timeoutsWolfram Sang1-1/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: img-scb: remove printout on handled timeoutsWolfram Sang1-4/+1
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout and simplify the logic a little. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: davinci: remove printout on handled timeoutsWolfram Sang1-1/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: cadence: remove printout on handled timeoutsWolfram Sang1-2/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Michal Simek <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: bcm2835: remove printout on handled timeoutsWolfram Sang1-1/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: bcm-iproc: remove printout on handled timeoutsWolfram Sang1-2/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: at91-master: remove printout on handled timeoutsWolfram Sang1-1/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: lpi2c: Avoid calling clk_get_rate during transferAlexander Stein1-3/+16
Instead of repeatedly calling clk_get_rate for each transfer, lock the clock rate and cache the value. A deadlock has been observed while adding tlv320aic32x4 audio codec to the system. When this clock provider adds its clock, the clk mutex is locked already, it needs to access i2c, which in return needs the mutex for clk_get_rate as well. Signed-off-by: Alexander Stein <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: i801: Annotate apanel_addr as __ro_after_initHeiner Kallweit1-1/+1
Annotate this variable as __ro_after_init to protect it from being overwritten later. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: mux: gpio: remove support for class-based device instantiationHeiner Kallweit2-4/+1
i801 as only user of gpio i2c mux removed support for class-based device instantiation on muxed busses. Class-based device instantiation is a legacy mechanism and shouldn't be used in new code, therefore remove support also here. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: i801: Remove usage of I2C_CLASS_SPDHeiner Kallweit1-4/+0
Only remaining client driver supporting I2C_CLASS_SPD is jc42. This type of thermal sensor can be found on several DDR3/DDR4 modules. i2c_register_spd() instantiates also such thermal sensor i2c devices. Since 893fef0bc6aa ("i2c: i801: Call i2c_register_spd for muxed child segments") i2c_register_spd() is called also for the remaining use case, systems with muxed SMBUS segments for SPD EEPROMs. Therefore I2C_CLASS_SPD class-based instantiation isn't needed any longer in this driver, so remove it. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: designware: Add ACPI ID for Granite Rapids-D I2C controllerShanth Murthy1-0/+1
Granite Rapids-D has additional I2C controller that is enumerated via ACPI. Add ACPI ID for it. Signed-off-by: Shanth Murthy <[email protected]> Signed-off-by: Jarkko Nikula <[email protected]> Signed-off-by: Andi Shyti <[email protected]>