powerpc: i2c-mpc: preserve I2C clocking
Subsystems (3)
PATCH v2 1/1 powerpc: i2c-mpc: preserve I2C clocking
The i2c node property "fsl,preserve-clocking" allows to overtake the clock settings from the boot loader avoiding the hard-coded settings.
--- Documentation/powerpc/dts-bindings/fsl/i2c.txt | 2 ++ drivers/i2c/busses/i2c-mpc.c | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-)
drivers/i2c/busses/i2c-mpc.c +11 -9
@@ -323,13 +323,6 @@if (!i2c)return -ENOMEM ; -if (of_get_property (op->node,"dfsrr" ,NULL )) - i2c->flags |=FSL_I2C_DEV_SEPARATE_DFSRR ; - -if (of_device_is_compatible (op->node,"fsl,mpc5200-i2c" ) || -of_device_is_compatible (op->node,"mpc5200-i2c" )) - i2c->flags |=FSL_I2C_DEV_CLOCK_5200 ; -init_waitqueue_head (&i2c->queue); i2c->base =of_iomap (op->node,0 );
@@ -348,8 +341,17 @@ goto fail_request; } } - -mpc_i2c_setclock (i2c); + +if (!of_get_property (op->node,"fsl,preserve-clocking" ,NULL )) { +if (of_get_property (op->node,"dfsrr" ,NULL )) + i2c->flags |=FSL_I2C_DEV_SEPARATE_DFSRR ; + +if (of_device_is_compatible (op->node,"fsl,mpc5200-i2c" ) || +of_device_is_compatible (op->node,"mpc5200-i2c" )) + i2c->flags |=FSL_I2C_DEV_CLOCK_5200 ; + +mpc_i2c_setclock (i2c); + }dev_set_drvdata (&op->dev, i2c);
Documentation/powerpc/dts-bindings/fsl/i2c.txt +2 -0
@@ -20,6 +20,8 @@ a digital filter sampling rate register - fsl5200-clocking : boolean; if defined, indicated that this device uses the FSL 5200 clocking mechanism. + - fsl,preserve-clocking : boolean; if defined, the clock settings + from the bootloader are preserved (not touched). Example : i2c@3000 {
A message that is not in the archive (sent off-list or not yet received): [email protected]
Grant Likely
Acked-byQuoted 4 lines · Wolfgang Grandegger
The i2c node property "fsl,preserve-clocking" allows to overtake the clock settings from the boot loader avoiding the hard-coded settings.
Signed-off-by Wolfgang Grandegger <[email protected]>
Quoted 57 lines
---
Documentation/powerpc/dts-bindings/fsl/i2c.txt | 2 ++drivers/i2c/busses/i2c-mpc.c| 20 +++++++++++---------2 files changed, 13 insertions(+), 9 deletions(-)Index:
linux-2.6/drivers/i2c/busses/i2c-mpc.c
===================================================================drivers/i2c/busses/i2c-mpc.c 2009-03-31 21:29:21.615721143 +0200 renamed from drivers/i2c/busses/i2c-mpc.c 2009-03-31 13:25:08.000000000 +0200 +11
-9@@ -323,13 +323,6 @@ if (!i2c) return -ENOMEM; - if (of_get_property(op->node, "dfsrr", NULL)) - i2c->flags |= FSL_I2C_DEV_SEPARATE_DFSRR; - - if (of_device_is_compatible(op->node, "fsl,mpc5200-i2c") || - of_device_is_compatible(op->node, "mpc5200-i2c")) - i2c->flags |= FSL_I2C_DEV_CLOCK_5200; - init_waitqueue_head(&i2c->queue); i2c->base = of_iomap(op->node, 0);@@ -348,8 +341,17 @@ goto fail_request; } } - - mpc_i2c_setclock(i2c); + + if (!of_get_property(op->node, "fsl,preserve-clocking", NULL)) { + if (of_get_property(op->node, "dfsrr", NULL)) + i2c->flags |= FSL_I2C_DEV_SEPARATE_DFSRR; + + if (of_device_is_compatible(op->node, "fsl,mpc5200-i2c") || + of_device_is_compatible(op->node, "mpc5200-i2c")) + i2c->flags |= FSL_I2C_DEV_CLOCK_5200; + + mpc_i2c_setclock(i2c); + } dev_set_drvdata(&op->dev, i2c);Index:
linux-2.6/Documentation/powerpc/dts-bindings/fsl/i2c.txt
===================================================================Documentation/powerpc/dts-bindings/fsl/i2c.txt 2009-03-31 21:35:51.527901532 +0200 renamed from Documentation/powerpc/dts-bindings/fsl/i2c.txt 2009-03-17 10:28:07.000000000 +0100 +0
-0@@ -20,6 +20,8 @@a digital filter sampling rate register
- fsl5200-clocking : boolean; if defined, indicated that this device uses the FSL 5200 clocking mechanism.
+ - fsl,preserve-clocking : boolean; if defined, the clock settings
+ from the bootloader are preserved (not touched).Example :
i2c@3000 {
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.