[PATCH 0/4] i2c: stm32: addition of STM32MP13 support
From: Alain Volmat <alain.volmat@foss.st.com>
Date: 2022-06-20 10:56:49
Subsystems: i2c subsystem, i2c subsystem host drivers, open firmware and flattened device tree bindings, st stm32 i2c/smbus driver, the rest · Maintainers: Andi Shyti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Pierre-Yves MORDRET, Alain Volmat, Linus Torvalds
Series: 4 patches touching 2 files, +16/-7
Status: Superseded by v2 (posted 2022-07-07). [go to v2]
Revision v1 (2 revisions archived).
11 messages, 4 authors, 2022-07-07 · open the first message on its own page
From: Alain Volmat <alain.volmat@foss.st.com>
Date: 2022-06-20 10:56:49
This series adds the support for the stm32mp13. Alain Volmat (4): dt-bindings: i2c: st,stm32-i2c: don't mandate a reset line i2c: stm32: only perform a reset if there is a reset property dt-bindings: i2c: st,stm32-i2c: add entry for stm32mp13 i2c: stm32: add support for the STM32MP13 soc .../devicetree/bindings/i2c/st,stm32-i2c.yaml | 3 ++- drivers/i2c/busses/i2c-stm32f7.c | 20 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) -- 2.25.1
From: Alain Volmat <alain.volmat@foss.st.com>
Date: 2022-06-20 10:56:45
Allow the driver to properly initialize even if there is no reset property given. In such case reset control is not done and initialization proceed. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> --- drivers/i2c/busses/i2c-stm32f7.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index 6d4aa64b195d..b29d8e476342 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c@@ -2138,13 +2138,14 @@ static int stm32f7_i2c_probe(struct platform_device *pdev) rst = devm_reset_control_get(&pdev->dev, NULL); if (IS_ERR(rst)) { - ret = dev_err_probe(&pdev->dev, PTR_ERR(rst), - "Error: Missing reset ctrl\n"); - goto clk_free; + ret = PTR_ERR(rst); + if (ret == -EPROBE_DEFER) + goto clk_free; + } else { + reset_control_assert(rst); + udelay(2); + reset_control_deassert(rst); } - reset_control_assert(rst); - udelay(2); - reset_control_deassert(rst); i2c_dev->dev = &pdev->dev;
--
2.25.1
From: Alain Volmat <alain.volmat@foss.st.com>
Date: 2022-06-20 10:56:57
Update the dt-bindings of the i2c-stm32 drivers to avoid the needs for a reset property in the device-tree. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> --- Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml | 1 - 1 file changed, 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml
index dccbb18b6dc0..8879144fbbfb 100644
--- a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml@@ -94,7 +94,6 @@ required: - compatible - reg - interrupts - - resets - clocks unevaluatedProperties: false
--
2.25.1
From: Alain Volmat <alain.volmat@foss.st.com>
Date: 2022-06-20 10:56:59
Add the new compatible for the stm32mp13. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> --- Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml
index 8879144fbbfb..d8ecfb39dc01 100644
--- a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml@@ -17,6 +17,7 @@ allOf: contains: enum: - st,stm32f7-i2c + - st,stm32mp13-i2c - st,stm32mp15-i2c then: properties:
@@ -45,6 +46,7 @@ properties: enum: - st,stm32f4-i2c - st,stm32f7-i2c + - st,stm32mp13-i2c - st,stm32mp15-i2c reg:
--
2.25.1
From: Alain Volmat <alain.volmat@foss.st.com>
Date: 2022-06-20 10:58:16
Add a new compatible for the stm32mp13. Fast Mode Plus control register address differ from the one for STM32MP15. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> --- drivers/i2c/busses/i2c-stm32f7.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index b29d8e476342..9946b330ddce 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c@@ -410,6 +410,12 @@ static const struct stm32f7_i2c_setup stm32mp15_setup = { .fmp_clr_offset = 0x40, }; +static const struct stm32f7_i2c_setup stm32mp13_setup = { + .rise_time = STM32F7_I2C_RISE_TIME_DEFAULT, + .fall_time = STM32F7_I2C_FALL_TIME_DEFAULT, + .fmp_clr_offset = 0x4, +}; + static inline void stm32f7_i2c_set_bits(void __iomem *reg, u32 mask) { writel_relaxed(readl_relaxed(reg) | mask, reg);
@@ -2469,6 +2475,7 @@ static const struct dev_pm_ops stm32f7_i2c_pm_ops = { static const struct of_device_id stm32f7_i2c_match[] = { { .compatible = "st,stm32f7-i2c", .data = &stm32f7_setup}, { .compatible = "st,stm32mp15-i2c", .data = &stm32mp15_setup}, + { .compatible = "st,stm32mp13-i2c", .data = &stm32mp13_setup}, {}, }; MODULE_DEVICE_TABLE(of, stm32f7_i2c_match);
--
2.25.1
From: Pierre Yves MORDRET <pierre-yves.mordret@foss.st.com>
Date: 2022-06-21 13:40:26
Hi All Look good to me. Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com> Regards On 6/20/22 12:54, Alain Volmat wrote:
Allow the driver to properly initialize even if there is no reset property given. In such case reset control is not done and initialization proceed. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> --- drivers/i2c/busses/i2c-stm32f7.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index 6d4aa64b195d..b29d8e476342 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c@@ -2138,13 +2138,14 @@ static int stm32f7_i2c_probe(struct platform_device *pdev) rst = devm_reset_control_get(&pdev->dev, NULL); if (IS_ERR(rst)) { - ret = dev_err_probe(&pdev->dev, PTR_ERR(rst), - "Error: Missing reset ctrl\n"); - goto clk_free; + ret = PTR_ERR(rst); + if (ret == -EPROBE_DEFER) + goto clk_free; + } else { + reset_control_assert(rst); + udelay(2); + reset_control_deassert(rst); } - reset_control_assert(rst); - udelay(2); - reset_control_deassert(rst); i2c_dev->dev = &pdev->dev;
-- -- ~ Py MORDRET --
From: Pierre Yves MORDRET <pierre-yves.mordret@foss.st.com>
Date: 2022-06-21 13:41:07
Hi All Look good to me. Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com> Regards On 6/20/22 12:54, Alain Volmat wrote:
Add a new compatible for the stm32mp13. Fast Mode Plus control register address differ from the one for STM32MP15. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> --- drivers/i2c/busses/i2c-stm32f7.c | 7 +++++++ 1 file changed, 7 insertions(+)diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index b29d8e476342..9946b330ddce 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c@@ -410,6 +410,12 @@ static const struct stm32f7_i2c_setup stm32mp15_setup = { .fmp_clr_offset = 0x40, }; +static const struct stm32f7_i2c_setup stm32mp13_setup = { + .rise_time = STM32F7_I2C_RISE_TIME_DEFAULT, + .fall_time = STM32F7_I2C_FALL_TIME_DEFAULT, + .fmp_clr_offset = 0x4, +}; + static inline void stm32f7_i2c_set_bits(void __iomem *reg, u32 mask) { writel_relaxed(readl_relaxed(reg) | mask, reg);@@ -2469,6 +2475,7 @@ static const struct dev_pm_ops stm32f7_i2c_pm_ops = { static const struct of_device_id stm32f7_i2c_match[] = { { .compatible = "st,stm32f7-i2c", .data = &stm32f7_setup}, { .compatible = "st,stm32mp15-i2c", .data = &stm32mp15_setup}, + { .compatible = "st,stm32mp13-i2c", .data = &stm32mp13_setup}, {}, }; MODULE_DEVICE_TABLE(of, stm32f7_i2c_match);
-- -- ~ Py MORDRET --
From: Rob Herring <robh@kernel.org>
Date: 2022-06-28 13:41:23
On Mon, Jun 20, 2022 at 12:54:02PM +0200, Alain Volmat wrote:
Update the dt-bindings of the i2c-stm32 drivers to avoid the needs for a reset property in the device-tree.
That is clear from the diff, but why. Some chips don't have a reset? If so, this should be combined with patch 2 as part of changes needed for a new version.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> --- Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml | 1 - 1 file changed, 1 deletion(-)diff --git a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml index dccbb18b6dc0..8879144fbbfb 100644 --- a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml +++ b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml@@ -94,7 +94,6 @@ required: - compatible - reg - interrupts - - resets - clocks unevaluatedProperties: false-- 2.25.1
From: Wolfram Sang <wsa@kernel.org>
Date: 2022-06-29 19:44:47
On Tue, Jun 28, 2022 at 07:41:15AM -0600, Rob Herring wrote:
On Mon, Jun 20, 2022 at 12:54:02PM +0200, Alain Volmat wrote:quoted
Update the dt-bindings of the i2c-stm32 drivers to avoid the needs for a reset property in the device-tree.That is clear from the diff, but why. Some chips don't have a reset? If so, this should be combined with patch 2 as part of changes needed for a new version.
What do you mean? Patches 1+2 should be squashed together? I can do this when applying. Or do you mean something else?
quoted
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> --- Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml | 1 - 1 file changed, 1 deletion(-)diff --git a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml index dccbb18b6dc0..8879144fbbfb 100644 --- a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml +++ b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml@@ -94,7 +94,6 @@ required: - compatible - reg - interrupts - - resets - clocks unevaluatedProperties: false-- 2.25.1
From: Rob Herring <robh@kernel.org>
Date: 2022-07-06 23:01:29
On Wed, Jun 29, 2022 at 09:44:37PM +0200, Wolfram Sang wrote:
On Tue, Jun 28, 2022 at 07:41:15AM -0600, Rob Herring wrote:quoted
On Mon, Jun 20, 2022 at 12:54:02PM +0200, Alain Volmat wrote:quoted
Update the dt-bindings of the i2c-stm32 drivers to avoid the needs for a reset property in the device-tree.That is clear from the diff, but why. Some chips don't have a reset? If so, this should be combined with patch 2 as part of changes needed for a new version.What do you mean? Patches 1+2 should be squashed together? I can do this when applying. Or do you mean something else?
Sorry, I meant combined with patch 3. If the new chip added in patch 3 doesn't have a reset, then 1 and 3 should be 1 patch. IOW, all the changes needed for a new chip in 1 patch. Rob
From: Alain Volmat <alain.volmat@foss.st.com>
Date: 2022-07-07 06:38:44
Hi Rob, On Tue, Jun 28, 2022 at 07:41:15AM -0600, Rob Herring wrote:
On Mon, Jun 20, 2022 at 12:54:02PM +0200, Alain Volmat wrote:quoted
Update the dt-bindings of the i2c-stm32 drivers to avoid the needs for a reset property in the device-tree.That is clear from the diff, but why. Some chips don't have a reset? If so, this should be combined with patch 2 as part of changes needed for a new version.
Alexandre has just pushed a pull-request enabling support for the clock/reset [1] so I will shortly push a v2 of the serie dropping the first 2 patches. Thanks Alain [1] https://lore.kernel.org/all/a250f32b-f67c-2922-0748-e39dc791e95c@foss.st.com/
quoted
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> --- Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml | 1 - 1 file changed, 1 deletion(-)diff --git a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml index dccbb18b6dc0..8879144fbbfb 100644 --- a/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml +++ b/Documentation/devicetree/bindings/i2c/st,stm32-i2c.yaml@@ -94,7 +94,6 @@ required: - compatible - reg - interrupts - - resets - clocks unevaluatedProperties: false-- 2.25.1