Hi,
This patchset contains following changes:
- Remove SMBUS quick command support
- Update full name of dt node to adapter name
Lori Hikichi (2):
i2c: iproc: Stop advertising support of SMBUS quick cmd
i2c: iproc: Add full name of devicetree node to adapter name
drivers/i2c/busses/i2c-bcm-iproc.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--
1.9.1
From: Lori Hikichi <[email protected]>
The driver does not support the SMBUS Quick command so remove the
flag that indicates that level of support.
By default the i2c_detect tool uses the quick command to try and
detect devices at some bus addresses. If the quick command is used
then we will not detect the device, even though it is present.
Fixes: e6e5dd3566e0 (i2c: iproc: Add Broadcom iProc I2C Driver)
Signed-off-by: Lori Hikichi <[email protected]>
Signed-off-by: Rayagonda Kokatanur <[email protected]>
---
drivers/i2c/busses/i2c-bcm-iproc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
index d7fd76b..19ef2b0 100644
--- a/drivers/i2c/busses/i2c-bcm-iproc.c
+++ b/drivers/i2c/busses/i2c-bcm-iproc.c
@@ -790,7 +790,10 @@ static int bcm_iproc_i2c_xfer(struct i2c_adapter *adapter,
static uint32_t bcm_iproc_i2c_functionality(struct i2c_adapter *adap)
{
- u32 val = I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+ u32 val;
+
+ /* We do not support the SMBUS Quick command */
+ val = I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK);
if (adap->algo->reg_slave)
val |= I2C_FUNC_SLAVE;
--
1.9.1
From: Lori Hikichi <[email protected]>
Add the full name of the devicetree node to the adapter name.
Without this change, all adapters have the same name making it difficult
to distinguish between multiple instances.
The most obvious way to see this is to use the utility i2c_detect.
e.g. "i2c-detect -l"
Before
i2c-1 i2c Broadcom iProc I2C adapter I2C adapter
i2c-0 i2c Broadcom iProc I2C adapter I2C adapter
After
i2c-1 i2c Broadcom iProc (i2c@e0000) I2C adapter
i2c-0 i2c Broadcom iProc (i2c@b0000) I2C adapter
Now it is easy to figure out which adapter maps to a which DT node.
Signed-off-by: Lori Hikichi <[email protected]>
Signed-off-by: Rayagonda Kokatanur <[email protected]>
---
drivers/i2c/busses/i2c-bcm-iproc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
index 19ef2b0..183b220 100644
--- a/drivers/i2c/busses/i2c-bcm-iproc.c
+++ b/drivers/i2c/busses/i2c-bcm-iproc.c
@@ -922,7 +922,9 @@ static int bcm_iproc_i2c_probe(struct platform_device *pdev)
adap = &iproc_i2c->adapter;
i2c_set_adapdata(adap, iproc_i2c);
- strlcpy(adap->name, "Broadcom iProc I2C adapter", sizeof(adap->name));
+ snprintf(adap->name, sizeof(adap->name),
+ "Broadcom iProc (%s)",
+ of_node_full_name(iproc_i2c->device->of_node));
adap->algo = &bcm_iproc_algo;
adap->quirks = &bcm_iproc_i2c_quirks;
adap->dev.parent = &pdev->dev;
--
1.9.1
On 8/7/19 8:37 PM, Rayagonda Kokatanur wrote:
> From: Lori Hikichi <[email protected]>
>
> Add the full name of the devicetree node to the adapter name.
> Without this change, all adapters have the same name making it difficult
> to distinguish between multiple instances.
> The most obvious way to see this is to use the utility i2c_detect.
> e.g. "i2c-detect -l"
>
> Before
> i2c-1 i2c Broadcom iProc I2C adapter I2C adapter
> i2c-0 i2c Broadcom iProc I2C adapter I2C adapter
>
> After
> i2c-1 i2c Broadcom iProc (i2c@e0000) I2C adapter
> i2c-0 i2c Broadcom iProc (i2c@b0000) I2C adapter
>
> Now it is easy to figure out which adapter maps to a which DT node.
>
> Signed-off-by: Lori Hikichi <[email protected]>
> Signed-off-by: Rayagonda Kokatanur <[email protected]>
> ---
> drivers/i2c/busses/i2c-bcm-iproc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
> index 19ef2b0..183b220 100644
> --- a/drivers/i2c/busses/i2c-bcm-iproc.c
> +++ b/drivers/i2c/busses/i2c-bcm-iproc.c
> @@ -922,7 +922,9 @@ static int bcm_iproc_i2c_probe(struct platform_device *pdev)
>
> adap = &iproc_i2c->adapter;
> i2c_set_adapdata(adap, iproc_i2c);
> - strlcpy(adap->name, "Broadcom iProc I2C adapter", sizeof(adap->name));
> + snprintf(adap->name, sizeof(adap->name),
> + "Broadcom iProc (%s)",
> + of_node_full_name(iproc_i2c->device->of_node));
> adap->algo = &bcm_iproc_algo;
> adap->quirks = &bcm_iproc_i2c_quirks;
> adap->dev.parent = &pdev->dev;
>
Looks good, thanks!
Reviewed-by: Ray Jui <[email protected]>
On 8/7/19 8:37 PM, Rayagonda Kokatanur wrote:
> From: Lori Hikichi <[email protected]>
>
> The driver does not support the SMBUS Quick command so remove the
> flag that indicates that level of support.
> By default the i2c_detect tool uses the quick command to try and
> detect devices at some bus addresses. If the quick command is used
> then we will not detect the device, even though it is present.
>
> Fixes: e6e5dd3566e0 (i2c: iproc: Add Broadcom iProc I2C Driver)
>
> Signed-off-by: Lori Hikichi <[email protected]>
> Signed-off-by: Rayagonda Kokatanur <[email protected]>
> ---
> drivers/i2c/busses/i2c-bcm-iproc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
> index d7fd76b..19ef2b0 100644
> --- a/drivers/i2c/busses/i2c-bcm-iproc.c
> +++ b/drivers/i2c/busses/i2c-bcm-iproc.c
> @@ -790,7 +790,10 @@ static int bcm_iproc_i2c_xfer(struct i2c_adapter *adapter,
>
> static uint32_t bcm_iproc_i2c_functionality(struct i2c_adapter *adap)
> {
> - u32 val = I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
> + u32 val;
> +
> + /* We do not support the SMBUS Quick command */
> + val = I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK);
>
> if (adap->algo->reg_slave)
> val |= I2C_FUNC_SLAVE;
>
Change looks good to me. Thanks.
Reviewed-by: Ray Jui <[email protected]>
On Thu, Aug 08, 2019 at 09:07:52AM +0530, Rayagonda Kokatanur wrote:
> From: Lori Hikichi <[email protected]>
>
> The driver does not support the SMBUS Quick command so remove the
> flag that indicates that level of support.
> By default the i2c_detect tool uses the quick command to try and
> detect devices at some bus addresses. If the quick command is used
> then we will not detect the device, even though it is present.
>
> Fixes: e6e5dd3566e0 (i2c: iproc: Add Broadcom iProc I2C Driver)
>
> Signed-off-by: Lori Hikichi <[email protected]>
> Signed-off-by: Rayagonda Kokatanur <[email protected]>
Applied to for-current, thanks!
On Thu, Aug 08, 2019 at 09:07:53AM +0530, Rayagonda Kokatanur wrote:
> From: Lori Hikichi <[email protected]>
>
> Add the full name of the devicetree node to the adapter name.
> Without this change, all adapters have the same name making it difficult
> to distinguish between multiple instances.
> The most obvious way to see this is to use the utility i2c_detect.
> e.g. "i2c-detect -l"
>
> Before
> i2c-1 i2c Broadcom iProc I2C adapter I2C adapter
> i2c-0 i2c Broadcom iProc I2C adapter I2C adapter
>
> After
> i2c-1 i2c Broadcom iProc (i2c@e0000) I2C adapter
> i2c-0 i2c Broadcom iProc (i2c@b0000) I2C adapter
>
> Now it is easy to figure out which adapter maps to a which DT node.
>
> Signed-off-by: Lori Hikichi <[email protected]>
> Signed-off-by: Rayagonda Kokatanur <[email protected]>
Applied to for-next, thanks!