2010-12-02 18:33:35

by Stephen Warren

[permalink] [raw]
Subject: [PATCH] mfd: tps6586x: Remove device ID check

... and convert it to a dev_info print at probe time.

There are many variants of this chip with different values of VERSIONCRC.
The set of values is large, and not useful to enumerate. All are SW
compatible. The difference lies in default settings of the various power
rails, and other similar differences. The driver, or clients of the
driver, shouldn't be affected by this, since all rails should be
programmed into the desired state in all cases for correct operation.

Derived-from-code-by: Andrew Chew <[email protected]>
Signed-off-by: Stephen Warren <[email protected]>
---
drivers/mfd/tps6586x.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index b4931ab..cb482ba 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -498,11 +498,7 @@ static int __devinit tps6586x_i2c_probe(struct i2c_client *client,
return -EIO;
}

- if ((ret != TPS658621A_VERSIONCRC) &&
- (ret != TPS658621C_VERSIONCRC)) {
- dev_err(&client->dev, "Unsupported chip ID: %x\n", ret);
- return -ENODEV;
- }
+ dev_info(&client->dev, "VERSIONCRC is %02x\n", ret);

tps6586x = kzalloc(sizeof(struct tps6586x), GFP_KERNEL);
if (tps6586x == NULL)
--
1.7.0.4
nvpublic


2010-12-02 21:02:12

by Andrew Chew

[permalink] [raw]
Subject: RE: [PATCH] mfd: tps6586x: Remove device ID check

> -----Original Message-----
> From: Stephen Warren [mailto:[email protected]]
> Sent: Thursday, December 02, 2010 10:33 AM
> To: [email protected]
> Cc: [email protected]; Andrew Chew; [email protected];
> Stephen Warren
> Subject: [PATCH] mfd: tps6586x: Remove device ID check
>
> ... and convert it to a dev_info print at probe time.
>
> There are many variants of this chip with different values of
> VERSIONCRC.
> The set of values is large, and not useful to enumerate. All are SW
> compatible. The difference lies in default settings of the
> various power
> rails, and other similar differences. The driver, or clients of the
> driver, shouldn't be affected by this, since all rails should be
> programmed into the desired state in all cases for correct operation.
>
> Derived-from-code-by: Andrew Chew <[email protected]>
> Signed-off-by: Stephen Warren <[email protected]>

LGTM.

Acked by: Andrew Chew <[email protected]>

2010-12-09 13:59:03

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH] mfd: tps6586x: Remove device ID check

Hi Stephen,

On Thu, Dec 02, 2010 at 11:33:22AM -0700, Stephen Warren wrote:
> ... and convert it to a dev_info print at probe time.
>
> There are many variants of this chip with different values of VERSIONCRC.
> The set of values is large, and not useful to enumerate. All are SW
> compatible. The difference lies in default settings of the various power
> rails, and other similar differences. The driver, or clients of the
> driver, shouldn't be affected by this, since all rails should be
> programmed into the desired state in all cases for correct operation.
Fair enough, but then you can remove the TPS658621A_VERSIONCRC and
TPS658621C_VERSIONCRC defines.

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/

2010-12-09 17:30:44

by Stephen Warren

[permalink] [raw]
Subject: [PATCH] mfd: tps6586x: Remove device ID check

... and convert it to a dev_info print at probe time.

There are many variants of this chip with different values of VERSIONCRC.
The set of values is large, and not useful to enumerate. All are SW
compatible. The difference lies in default settings of the various power
rails, and other similar differences. The driver, or clients of the
driver, shouldn't be affected by this, since all rails should be
programmed into the desired state in all cases for correct operation.

Derived-from-code-by: Andrew Chew <[email protected]>
Signed-off-by: Stephen Warren <[email protected]>
---
drivers/mfd/tps6586x.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index b4931ab..3575739 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -46,8 +46,6 @@

/* device id */
#define TPS6586X_VERSIONCRC 0xcd
-#define TPS658621A_VERSIONCRC 0x15
-#define TPS658621C_VERSIONCRC 0x2c

struct tps6586x_irq_data {
u8 mask_reg;
@@ -498,11 +496,7 @@ static int __devinit tps6586x_i2c_probe(struct i2c_client *client,
return -EIO;
}

- if ((ret != TPS658621A_VERSIONCRC) &&
- (ret != TPS658621C_VERSIONCRC)) {
- dev_err(&client->dev, "Unsupported chip ID: %x\n", ret);
- return -ENODEV;
- }
+ dev_info(&client->dev, "VERSIONCRC is %02x\n", ret);

tps6586x = kzalloc(sizeof(struct tps6586x), GFP_KERNEL);
if (tps6586x == NULL)
--
1.7.0.4

2010-12-16 20:35:26

by Stephen Warren

[permalink] [raw]
Subject: RE: [PATCH] mfd: tps6586x: Remove device ID check

> From: Stephen Warren [mailto:[email protected]]
> Sent: Thursday, December 09, 2010 10:30 AM
>
> ... and convert it to a dev_info print at probe time.

Samuel,

Sorry to ping you, but does this updated patch look OK and address your
concerns? Thanks.

> There are many variants of this chip with different values of VERSIONCRC.
> The set of values is large, and not useful to enumerate. All are SW
> compatible. The difference lies in default settings of the various power
> rails, and other similar differences. The driver, or clients of the
> driver, shouldn't be affected by this, since all rails should be
> programmed into the desired state in all cases for correct operation.
>
> Derived-from-code-by: Andrew Chew <[email protected]>
> Signed-off-by: Stephen Warren <[email protected]>
> ---
> drivers/mfd/tps6586x.c | 8 +-------
> 1 files changed, 1 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
> index b4931ab..3575739 100644
> --- a/drivers/mfd/tps6586x.c
> +++ b/drivers/mfd/tps6586x.c
> @@ -46,8 +46,6 @@
>
> /* device id */
> #define TPS6586X_VERSIONCRC 0xcd
> -#define TPS658621A_VERSIONCRC 0x15
> -#define TPS658621C_VERSIONCRC 0x2c
>
> struct tps6586x_irq_data {
> u8 mask_reg;
> @@ -498,11 +496,7 @@ static int __devinit tps6586x_i2c_probe(struct i2c_client *client,
> return -EIO;
> }
>
> - if ((ret != TPS658621A_VERSIONCRC) &&
> - (ret != TPS658621C_VERSIONCRC)) {
> - dev_err(&client->dev, "Unsupported chip ID: %x\n", ret);
> - return -ENODEV;
> - }
> + dev_info(&client->dev, "VERSIONCRC is %02x\n", ret);
>
> tps6586x = kzalloc(sizeof(struct tps6586x), GFP_KERNEL);
> if (tps6586x == NULL)
> --
> 1.7.0.4

--
nvpublic

2010-12-19 22:43:59

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH] mfd: tps6586x: Remove device ID check

Hi Stephen,

On Thu, Dec 09, 2010 at 10:30:11AM -0700, Stephen Warren wrote:
> ... and convert it to a dev_info print at probe time.
>
> There are many variants of this chip with different values of VERSIONCRC.
> The set of values is large, and not useful to enumerate. All are SW
> compatible. The difference lies in default settings of the various power
> rails, and other similar differences. The driver, or clients of the
> driver, shouldn't be affected by this, since all rails should be
> programmed into the desired state in all cases for correct operation.
>
> Derived-from-code-by: Andrew Chew <[email protected]>
> Signed-off-by: Stephen Warren <[email protected]>
Patch applied, thanks a lot.

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/