Skip to content

Commit 67936a4

Browse files
committed
Merge branch 'i2c/for-current-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "I2C has three driver fixes for the newly introduced drivers and one ID addition for the i801 driver" * 'i2c/for-current-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: i2c-stm32f7: make structure stm32f7_setup static const i2c: ensure termination of *_device_id tables i2c: i801: Add support for Intel Cedar Fork i2c: stm32f7: fix setup structure
2 parents 031b814 + 25f2f44 commit 67936a4

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

Documentation/i2c/busses/i2c-i801

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Supported adapters:
3636
* Intel Gemini Lake (SOC)
3737
* Intel Cannon Lake-H (PCH)
3838
* Intel Cannon Lake-LP (PCH)
39+
* Intel Cedar Fork (PCH)
3940
Datasheets: Publicly available at the Intel website
4041

4142
On Intel Patsburg and later chipsets, both the normal host SMBus controller

drivers/i2c/busses/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ config I2C_I801
131131
Gemini Lake (SOC)
132132
Cannon Lake-H (PCH)
133133
Cannon Lake-LP (PCH)
134+
Cedar Fork (PCH)
134135

135136
This driver can also be built as a module. If so, the module
136137
will be called i2c-i801.

drivers/i2c/busses/i2c-i801.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
* Gemini Lake (SOC) 0x31d4 32 hard yes yes yes
6969
* Cannon Lake-H (PCH) 0xa323 32 hard yes yes yes
7070
* Cannon Lake-LP (PCH) 0x9da3 32 hard yes yes yes
71+
* Cedar Fork (PCH) 0x18df 32 hard yes yes yes
7172
*
7273
* Features supported by this driver:
7374
* Software PEC no
@@ -204,6 +205,7 @@
204205

205206
/* Older devices have their ID defined in <linux/pci_ids.h> */
206207
#define PCI_DEVICE_ID_INTEL_BAYTRAIL_SMBUS 0x0f12
208+
#define PCI_DEVICE_ID_INTEL_CDF_SMBUS 0x18df
207209
#define PCI_DEVICE_ID_INTEL_DNV_SMBUS 0x19df
208210
#define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22
209211
#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22
@@ -1025,6 +1027,7 @@ static const struct pci_device_id i801_ids[] = {
10251027
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BRASWELL_SMBUS) },
10261028
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS) },
10271029
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SMBUS) },
1030+
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CDF_SMBUS) },
10281031
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_SMBUS) },
10291032
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BROXTON_SMBUS) },
10301033
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LEWISBURG_SMBUS) },
@@ -1513,6 +1516,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
15131516
case PCI_DEVICE_ID_INTEL_CANNONLAKE_LP_SMBUS:
15141517
case PCI_DEVICE_ID_INTEL_LEWISBURG_SMBUS:
15151518
case PCI_DEVICE_ID_INTEL_LEWISBURG_SSKU_SMBUS:
1519+
case PCI_DEVICE_ID_INTEL_CDF_SMBUS:
15161520
case PCI_DEVICE_ID_INTEL_DNV_SMBUS:
15171521
case PCI_DEVICE_ID_INTEL_KABYLAKE_PCH_H_SMBUS:
15181522
priv->features |= FEATURE_I2C_BLOCK_READ;

drivers/i2c/busses/i2c-sprd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ static const struct dev_pm_ops sprd_i2c_pm_ops = {
627627

628628
static const struct of_device_id sprd_i2c_of_match[] = {
629629
{ .compatible = "sprd,sc9860-i2c", },
630+
{},
630631
};
631632

632633
static struct platform_driver sprd_i2c_driver = {

drivers/i2c/busses/i2c-stm32f7.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ struct stm32f7_i2c_dev {
215215
unsigned int msg_num;
216216
unsigned int msg_id;
217217
struct stm32f7_i2c_msg f7_msg;
218-
struct stm32f7_i2c_setup *setup;
218+
struct stm32f7_i2c_setup setup;
219219
struct stm32f7_i2c_timings timing;
220220
};
221221

@@ -265,7 +265,7 @@ static struct stm32f7_i2c_spec i2c_specs[] = {
265265
},
266266
};
267267

268-
struct stm32f7_i2c_setup stm32f7_setup = {
268+
static const struct stm32f7_i2c_setup stm32f7_setup = {
269269
.rise_time = STM32F7_I2C_RISE_TIME_DEFAULT,
270270
.fall_time = STM32F7_I2C_FALL_TIME_DEFAULT,
271271
.dnf = STM32F7_I2C_DNF_DEFAULT,
@@ -537,7 +537,7 @@ static void stm32f7_i2c_hw_config(struct stm32f7_i2c_dev *i2c_dev)
537537
writel_relaxed(timing, i2c_dev->base + STM32F7_I2C_TIMINGR);
538538

539539
/* Enable I2C */
540-
if (i2c_dev->setup->analog_filter)
540+
if (i2c_dev->setup.analog_filter)
541541
stm32f7_i2c_clr_bits(i2c_dev->base + STM32F7_I2C_CR1,
542542
STM32F7_I2C_CR1_ANFOFF);
543543
else
@@ -887,22 +887,19 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)
887887
}
888888

889889
setup = of_device_get_match_data(&pdev->dev);
890-
i2c_dev->setup->rise_time = setup->rise_time;
891-
i2c_dev->setup->fall_time = setup->fall_time;
892-
i2c_dev->setup->dnf = setup->dnf;
893-
i2c_dev->setup->analog_filter = setup->analog_filter;
890+
i2c_dev->setup = *setup;
894891

895892
ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns",
896893
&rise_time);
897894
if (!ret)
898-
i2c_dev->setup->rise_time = rise_time;
895+
i2c_dev->setup.rise_time = rise_time;
899896

900897
ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-falling-time-ns",
901898
&fall_time);
902899
if (!ret)
903-
i2c_dev->setup->fall_time = fall_time;
900+
i2c_dev->setup.fall_time = fall_time;
904901

905-
ret = stm32f7_i2c_setup_timing(i2c_dev, i2c_dev->setup);
902+
ret = stm32f7_i2c_setup_timing(i2c_dev, &i2c_dev->setup);
906903
if (ret)
907904
goto clk_free;
908905

0 commit comments

Comments
 (0)