linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] Remove smbus quick cmd and update adapter name
@ 2019-08-08  3:37 Rayagonda Kokatanur
  2019-08-08  3:37 ` [PATCH v1 1/2] i2c: iproc: Stop advertising support of SMBUS quick cmd Rayagonda Kokatanur
  2019-08-08  3:37 ` [PATCH v1 2/2] i2c: iproc: Add full name of devicetree node to adapter name Rayagonda Kokatanur
  0 siblings, 2 replies; 7+ messages in thread
From: Rayagonda Kokatanur @ 2019-08-08  3:37 UTC (permalink / raw)
  To: Wolfram Sang, Rob Herring, Mark Rutland
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-kernel,
	bcm-kernel-feedback-list, Ray Jui, Rayagonda Kokatanur,
	Florian Fainelli

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v1 1/2] i2c: iproc: Stop advertising support of SMBUS quick cmd
  2019-08-08  3:37 [PATCH v1 0/2] Remove smbus quick cmd and update adapter name Rayagonda Kokatanur
@ 2019-08-08  3:37 ` Rayagonda Kokatanur
  2019-08-12 17:29   ` Ray Jui
  2019-08-30 12:58   ` Wolfram Sang
  2019-08-08  3:37 ` [PATCH v1 2/2] i2c: iproc: Add full name of devicetree node to adapter name Rayagonda Kokatanur
  1 sibling, 2 replies; 7+ messages in thread
From: Rayagonda Kokatanur @ 2019-08-08  3:37 UTC (permalink / raw)
  To: Wolfram Sang, Rob Herring, Mark Rutland
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-kernel,
	bcm-kernel-feedback-list, Ray Jui, Rayagonda Kokatanur,
	Florian Fainelli, Lori Hikichi

From: Lori Hikichi <lori.hikichi@broadcom.com>

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 <lori.hikichi@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v1 2/2] i2c: iproc: Add full name of devicetree node to adapter name
  2019-08-08  3:37 [PATCH v1 0/2] Remove smbus quick cmd and update adapter name Rayagonda Kokatanur
  2019-08-08  3:37 ` [PATCH v1 1/2] i2c: iproc: Stop advertising support of SMBUS quick cmd Rayagonda Kokatanur
@ 2019-08-08  3:37 ` Rayagonda Kokatanur
  2019-08-12 17:29   ` Ray Jui
  2019-08-30 12:59   ` Wolfram Sang
  1 sibling, 2 replies; 7+ messages in thread
From: Rayagonda Kokatanur @ 2019-08-08  3:37 UTC (permalink / raw)
  To: Wolfram Sang, Rob Herring, Mark Rutland
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-kernel,
	bcm-kernel-feedback-list, Ray Jui, Rayagonda Kokatanur,
	Florian Fainelli, Lori Hikichi

From: Lori Hikichi <lori.hikichi@broadcom.com>

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 <lori.hikichi@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/2] i2c: iproc: Stop advertising support of SMBUS quick cmd
  2019-08-08  3:37 ` [PATCH v1 1/2] i2c: iproc: Stop advertising support of SMBUS quick cmd Rayagonda Kokatanur
@ 2019-08-12 17:29   ` Ray Jui
  2019-08-30 12:58   ` Wolfram Sang
  1 sibling, 0 replies; 7+ messages in thread
From: Ray Jui @ 2019-08-12 17:29 UTC (permalink / raw)
  To: Rayagonda Kokatanur, Wolfram Sang, Rob Herring, Mark Rutland
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-kernel,
	bcm-kernel-feedback-list, Florian Fainelli, Lori Hikichi



On 8/7/19 8:37 PM, Rayagonda Kokatanur wrote:
> From: Lori Hikichi <lori.hikichi@broadcom.com>
> 
> 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 <lori.hikichi@broadcom.com>
> Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
> ---
>   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 <ray.jui@broadcom.com>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 2/2] i2c: iproc: Add full name of devicetree node to adapter name
  2019-08-08  3:37 ` [PATCH v1 2/2] i2c: iproc: Add full name of devicetree node to adapter name Rayagonda Kokatanur
@ 2019-08-12 17:29   ` Ray Jui
  2019-08-30 12:59   ` Wolfram Sang
  1 sibling, 0 replies; 7+ messages in thread
From: Ray Jui @ 2019-08-12 17:29 UTC (permalink / raw)
  To: Rayagonda Kokatanur, Wolfram Sang, Rob Herring, Mark Rutland
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-kernel,
	bcm-kernel-feedback-list, Florian Fainelli, Lori Hikichi



On 8/7/19 8:37 PM, Rayagonda Kokatanur wrote:
> From: Lori Hikichi <lori.hikichi@broadcom.com>
> 
> 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 <lori.hikichi@broadcom.com>
> Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
> ---
>   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 <ray.jui@broadcom.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/2] i2c: iproc: Stop advertising support of SMBUS quick cmd
  2019-08-08  3:37 ` [PATCH v1 1/2] i2c: iproc: Stop advertising support of SMBUS quick cmd Rayagonda Kokatanur
  2019-08-12 17:29   ` Ray Jui
@ 2019-08-30 12:58   ` Wolfram Sang
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2019-08-30 12:58 UTC (permalink / raw)
  To: Rayagonda Kokatanur
  Cc: Rob Herring, Mark Rutland, linux-i2c, devicetree,
	linux-arm-kernel, linux-kernel, bcm-kernel-feedback-list,
	Ray Jui, Florian Fainelli, Lori Hikichi

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

On Thu, Aug 08, 2019 at 09:07:52AM +0530, Rayagonda Kokatanur wrote:
> From: Lori Hikichi <lori.hikichi@broadcom.com>
> 
> 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 <lori.hikichi@broadcom.com>
> Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 2/2] i2c: iproc: Add full name of devicetree node to adapter name
  2019-08-08  3:37 ` [PATCH v1 2/2] i2c: iproc: Add full name of devicetree node to adapter name Rayagonda Kokatanur
  2019-08-12 17:29   ` Ray Jui
@ 2019-08-30 12:59   ` Wolfram Sang
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2019-08-30 12:59 UTC (permalink / raw)
  To: Rayagonda Kokatanur
  Cc: Rob Herring, Mark Rutland, linux-i2c, devicetree,
	linux-arm-kernel, linux-kernel, bcm-kernel-feedback-list,
	Ray Jui, Florian Fainelli, Lori Hikichi

[-- Attachment #1: Type: text/plain, Size: 885 bytes --]

On Thu, Aug 08, 2019 at 09:07:53AM +0530, Rayagonda Kokatanur wrote:
> From: Lori Hikichi <lori.hikichi@broadcom.com>
> 
> 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 <lori.hikichi@broadcom.com>
> Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-30 12:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08  3:37 [PATCH v1 0/2] Remove smbus quick cmd and update adapter name Rayagonda Kokatanur
2019-08-08  3:37 ` [PATCH v1 1/2] i2c: iproc: Stop advertising support of SMBUS quick cmd Rayagonda Kokatanur
2019-08-12 17:29   ` Ray Jui
2019-08-30 12:58   ` Wolfram Sang
2019-08-08  3:37 ` [PATCH v1 2/2] i2c: iproc: Add full name of devicetree node to adapter name Rayagonda Kokatanur
2019-08-12 17:29   ` Ray Jui
2019-08-30 12:59   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).