diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-07 13:07:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-07 13:07:51 -0400 |
commit | 67936a41e597331c991528c5e5bd791cfbb1b1d6 (patch) | |
tree | fe4e25830e423d8cea4fe4bcb22ee89a70916fb9 | |
parent | 031b814030dc1bc353ce94da6816579228ba0e8b (diff) | |
parent | 25f2f440989c7079fdd8fccd54592cc077b63ae5 (diff) |
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
-rw-r--r-- | Documentation/i2c/busses/i2c-i801 | 1 | ||||
-rw-r--r-- | drivers/i2c/busses/Kconfig | 1 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sprd.c | 1 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-stm32f7.c | 17 |
5 files changed, 14 insertions, 10 deletions
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801 index 0500193434cb..d47702456926 100644 --- a/Documentation/i2c/busses/i2c-i801 +++ b/Documentation/i2c/busses/i2c-i801 | |||
@@ -36,6 +36,7 @@ Supported adapters: | |||
36 | * Intel Gemini Lake (SOC) | 36 | * Intel Gemini Lake (SOC) |
37 | * Intel Cannon Lake-H (PCH) | 37 | * Intel Cannon Lake-H (PCH) |
38 | * Intel Cannon Lake-LP (PCH) | 38 | * Intel Cannon Lake-LP (PCH) |
39 | * Intel Cedar Fork (PCH) | ||
39 | Datasheets: Publicly available at the Intel website | 40 | Datasheets: Publicly available at the Intel website |
40 | 41 | ||
41 | On Intel Patsburg and later chipsets, both the normal host SMBus controller | 42 | On Intel Patsburg and later chipsets, both the normal host SMBus controller |
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index c06dce2c1da7..45a3f3ca29b3 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -131,6 +131,7 @@ config I2C_I801 | |||
131 | Gemini Lake (SOC) | 131 | Gemini Lake (SOC) |
132 | Cannon Lake-H (PCH) | 132 | Cannon Lake-H (PCH) |
133 | Cannon Lake-LP (PCH) | 133 | Cannon Lake-LP (PCH) |
134 | Cedar Fork (PCH) | ||
134 | 135 | ||
135 | This driver can also be built as a module. If so, the module | 136 | This driver can also be built as a module. If so, the module |
136 | will be called i2c-i801. | 137 | will be called i2c-i801. |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index e114e4e00d29..9e12a53ef7b8 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -68,6 +68,7 @@ | |||
68 | * Gemini Lake (SOC) 0x31d4 32 hard yes yes yes | 68 | * Gemini Lake (SOC) 0x31d4 32 hard yes yes yes |
69 | * Cannon Lake-H (PCH) 0xa323 32 hard yes yes yes | 69 | * Cannon Lake-H (PCH) 0xa323 32 hard yes yes yes |
70 | * Cannon Lake-LP (PCH) 0x9da3 32 hard yes yes yes | 70 | * Cannon Lake-LP (PCH) 0x9da3 32 hard yes yes yes |
71 | * Cedar Fork (PCH) 0x18df 32 hard yes yes yes | ||
71 | * | 72 | * |
72 | * Features supported by this driver: | 73 | * Features supported by this driver: |
73 | * Software PEC no | 74 | * Software PEC no |
@@ -204,6 +205,7 @@ | |||
204 | 205 | ||
205 | /* Older devices have their ID defined in <linux/pci_ids.h> */ | 206 | /* Older devices have their ID defined in <linux/pci_ids.h> */ |
206 | #define PCI_DEVICE_ID_INTEL_BAYTRAIL_SMBUS 0x0f12 | 207 | #define PCI_DEVICE_ID_INTEL_BAYTRAIL_SMBUS 0x0f12 |
208 | #define PCI_DEVICE_ID_INTEL_CDF_SMBUS 0x18df | ||
207 | #define PCI_DEVICE_ID_INTEL_DNV_SMBUS 0x19df | 209 | #define PCI_DEVICE_ID_INTEL_DNV_SMBUS 0x19df |
208 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22 | 210 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22 |
209 | #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 | 211 | #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 |
@@ -1025,6 +1027,7 @@ static const struct pci_device_id i801_ids[] = { | |||
1025 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BRASWELL_SMBUS) }, | 1027 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BRASWELL_SMBUS) }, |
1026 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS) }, | 1028 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS) }, |
1027 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SMBUS) }, | 1029 | { 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) }, | ||
1028 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_SMBUS) }, | 1031 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_SMBUS) }, |
1029 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BROXTON_SMBUS) }, | 1032 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BROXTON_SMBUS) }, |
1030 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LEWISBURG_SMBUS) }, | 1033 | { 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) | |||
1513 | case PCI_DEVICE_ID_INTEL_CANNONLAKE_LP_SMBUS: | 1516 | case PCI_DEVICE_ID_INTEL_CANNONLAKE_LP_SMBUS: |
1514 | case PCI_DEVICE_ID_INTEL_LEWISBURG_SMBUS: | 1517 | case PCI_DEVICE_ID_INTEL_LEWISBURG_SMBUS: |
1515 | case PCI_DEVICE_ID_INTEL_LEWISBURG_SSKU_SMBUS: | 1518 | case PCI_DEVICE_ID_INTEL_LEWISBURG_SSKU_SMBUS: |
1519 | case PCI_DEVICE_ID_INTEL_CDF_SMBUS: | ||
1516 | case PCI_DEVICE_ID_INTEL_DNV_SMBUS: | 1520 | case PCI_DEVICE_ID_INTEL_DNV_SMBUS: |
1517 | case PCI_DEVICE_ID_INTEL_KABYLAKE_PCH_H_SMBUS: | 1521 | case PCI_DEVICE_ID_INTEL_KABYLAKE_PCH_H_SMBUS: |
1518 | priv->features |= FEATURE_I2C_BLOCK_READ; | 1522 | priv->features |= FEATURE_I2C_BLOCK_READ; |
diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c index 22e08ae1704f..25fcc3c1e32b 100644 --- a/drivers/i2c/busses/i2c-sprd.c +++ b/drivers/i2c/busses/i2c-sprd.c | |||
@@ -627,6 +627,7 @@ static const struct dev_pm_ops sprd_i2c_pm_ops = { | |||
627 | 627 | ||
628 | static const struct of_device_id sprd_i2c_of_match[] = { | 628 | static const struct of_device_id sprd_i2c_of_match[] = { |
629 | { .compatible = "sprd,sc9860-i2c", }, | 629 | { .compatible = "sprd,sc9860-i2c", }, |
630 | {}, | ||
630 | }; | 631 | }; |
631 | 632 | ||
632 | static struct platform_driver sprd_i2c_driver = { | 633 | static struct platform_driver sprd_i2c_driver = { |
diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index 47c67b0ca896..d4a6e9c2e9aa 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c | |||
@@ -215,7 +215,7 @@ struct stm32f7_i2c_dev { | |||
215 | unsigned int msg_num; | 215 | unsigned int msg_num; |
216 | unsigned int msg_id; | 216 | unsigned int msg_id; |
217 | struct stm32f7_i2c_msg f7_msg; | 217 | struct stm32f7_i2c_msg f7_msg; |
218 | struct stm32f7_i2c_setup *setup; | 218 | struct stm32f7_i2c_setup setup; |
219 | struct stm32f7_i2c_timings timing; | 219 | struct stm32f7_i2c_timings timing; |
220 | }; | 220 | }; |
221 | 221 | ||
@@ -265,7 +265,7 @@ static struct stm32f7_i2c_spec i2c_specs[] = { | |||
265 | }, | 265 | }, |
266 | }; | 266 | }; |
267 | 267 | ||
268 | struct stm32f7_i2c_setup stm32f7_setup = { | 268 | static const struct stm32f7_i2c_setup stm32f7_setup = { |
269 | .rise_time = STM32F7_I2C_RISE_TIME_DEFAULT, | 269 | .rise_time = STM32F7_I2C_RISE_TIME_DEFAULT, |
270 | .fall_time = STM32F7_I2C_FALL_TIME_DEFAULT, | 270 | .fall_time = STM32F7_I2C_FALL_TIME_DEFAULT, |
271 | .dnf = STM32F7_I2C_DNF_DEFAULT, | 271 | .dnf = STM32F7_I2C_DNF_DEFAULT, |
@@ -537,7 +537,7 @@ static void stm32f7_i2c_hw_config(struct stm32f7_i2c_dev *i2c_dev) | |||
537 | writel_relaxed(timing, i2c_dev->base + STM32F7_I2C_TIMINGR); | 537 | writel_relaxed(timing, i2c_dev->base + STM32F7_I2C_TIMINGR); |
538 | 538 | ||
539 | /* Enable I2C */ | 539 | /* Enable I2C */ |
540 | if (i2c_dev->setup->analog_filter) | 540 | if (i2c_dev->setup.analog_filter) |
541 | stm32f7_i2c_clr_bits(i2c_dev->base + STM32F7_I2C_CR1, | 541 | stm32f7_i2c_clr_bits(i2c_dev->base + STM32F7_I2C_CR1, |
542 | STM32F7_I2C_CR1_ANFOFF); | 542 | STM32F7_I2C_CR1_ANFOFF); |
543 | else | 543 | else |
@@ -887,22 +887,19 @@ static int stm32f7_i2c_probe(struct platform_device *pdev) | |||
887 | } | 887 | } |
888 | 888 | ||
889 | setup = of_device_get_match_data(&pdev->dev); | 889 | setup = of_device_get_match_data(&pdev->dev); |
890 | i2c_dev->setup->rise_time = setup->rise_time; | 890 | i2c_dev->setup = *setup; |
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; | ||
894 | 891 | ||
895 | ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns", | 892 | ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns", |
896 | &rise_time); | 893 | &rise_time); |
897 | if (!ret) | 894 | if (!ret) |
898 | i2c_dev->setup->rise_time = rise_time; | 895 | i2c_dev->setup.rise_time = rise_time; |
899 | 896 | ||
900 | ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-falling-time-ns", | 897 | ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-falling-time-ns", |
901 | &fall_time); | 898 | &fall_time); |
902 | if (!ret) | 899 | if (!ret) |
903 | i2c_dev->setup->fall_time = fall_time; | 900 | i2c_dev->setup.fall_time = fall_time; |
904 | 901 | ||
905 | ret = stm32f7_i2c_setup_timing(i2c_dev, i2c_dev->setup); | 902 | ret = stm32f7_i2c_setup_timing(i2c_dev, &i2c_dev->setup); |
906 | if (ret) | 903 | if (ret) |
907 | goto clk_free; | 904 | goto clk_free; |
908 | 905 | ||