* [PATCH] rtc-pcf8563: Remove client validation
@ 2008-07-02 11:32 Laurent Pinchart
[not found] ` <200807021332.15495.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2008-07-02 11:32 UTC (permalink / raw)
To: rtc-linux-/JYPxA39Uh5TLH3MbocFFw, a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
i2c-GZX6beZjE8VD60Wz+7aTrA, Rod Whitby, Jean Delvare
Validating clients with black magic register checks doesn't make much sense
for new-style i2c driver and has been known to fail on valid NXP pcf8563 chips.
This patch removes the client validation code.
Signed-off-by: Laurent Pinchart <laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>
---
drivers/rtc/rtc-pcf8563.c | 58 ---------------------------------------------
1 files changed, 0 insertions(+), 58 deletions(-)
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
index 0fc4c36..59ab8b4 100644
--- a/drivers/rtc/rtc-pcf8563.c
+++ b/drivers/rtc/rtc-pcf8563.c
@@ -179,58 +179,6 @@ struct pcf8563_limit
unsigned char max;
};
-static int pcf8563_validate_client(struct i2c_client *client)
-{
- int i;
-
- static const struct pcf8563_limit pattern[] = {
- /* register, mask, min, max */
- { PCF8563_REG_SC, 0x7F, 0, 59 },
- { PCF8563_REG_MN, 0x7F, 0, 59 },
- { PCF8563_REG_HR, 0x3F, 0, 23 },
- { PCF8563_REG_DM, 0x3F, 0, 31 },
- { PCF8563_REG_MO, 0x1F, 0, 12 },
- };
-
- /* check limits (only registers with bcd values) */
- for (i = 0; i < ARRAY_SIZE(pattern); i++) {
- int xfer;
- unsigned char value;
- unsigned char buf = pattern[i].reg;
-
- struct i2c_msg msgs[] = {
- { client->addr, 0, 1, &buf },
- { client->addr, I2C_M_RD, 1, &buf },
- };
-
- xfer = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
-
- if (xfer != ARRAY_SIZE(msgs)) {
- dev_err(&client->dev,
- "%s: could not read register 0x%02X\n",
- __func__, pattern[i].reg);
-
- return -EIO;
- }
-
- value = BCD2BIN(buf & pattern[i].mask);
-
- if (value > pattern[i].max ||
- value < pattern[i].min) {
- dev_dbg(&client->dev,
- "%s: pattern=%d, reg=%x, mask=0x%02x, min=%d, "
- "max=%d, value=%d, raw=0x%02X\n",
- __func__, i, pattern[i].reg, pattern[i].mask,
- pattern[i].min, pattern[i].max,
- value, buf);
-
- return -ENODEV;
- }
- }
-
- return 0;
-}
-
static int pcf8563_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
return pcf8563_get_datetime(to_i2c_client(dev), tm);
@@ -262,12 +210,6 @@ static int pcf8563_probe(struct i2c_client *client,
if (!pcf8563)
return -ENOMEM;
- /* Verify the chip is really an PCF8563 */
- if (pcf8563_validate_client(client) < 0) {
- err = -ENODEV;
- goto exit_kfree;
- }
-
dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n");
pcf8563->rtc = rtc_device_register(pcf8563_driver.driver.name,
--
1.5.0
--
Laurent Pinchart
CSE Semaphore Belgium
Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium
T +32 (2) 387 42 59
F +32 (2) 387 42 75
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <200807021332.15495.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>]
* Re: [PATCH] rtc-pcf8563: Remove client validation [not found] ` <200807021332.15495.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org> @ 2008-07-02 11:34 ` Jean Delvare [not found] ` <20080702133457.05a75e7c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Jean Delvare @ 2008-07-02 11:34 UTC (permalink / raw) To: Laurent Pinchart Cc: a.zummo-BfzFCNDTiLLj+vYz1yj4TQ, i2c-GZX6beZjE8VD60Wz+7aTrA, rtc-linux-/JYPxA39Uh5TLH3MbocFFw, Rod Whitby On Wed, 2 Jul 2008 13:32:14 +0200, Laurent Pinchart wrote: > Validating clients with black magic register checks doesn't make much sense > for new-style i2c driver and has been known to fail on valid NXP pcf8563 chips. > This patch removes the client validation code. > > Signed-off-by: Laurent Pinchart <laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org> > --- > drivers/rtc/rtc-pcf8563.c | 58 --------------------------------------------- > 1 files changed, 0 insertions(+), 58 deletions(-) > (...) Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> Thanks, -- Jean Delvare _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20080702133457.05a75e7c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>]
* Re: [PATCH] rtc-pcf8563: Remove client validation [not found] ` <20080702133457.05a75e7c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org> @ 2008-07-22 15:56 ` Laurent Pinchart [not found] ` <200807221756.44738.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Laurent Pinchart @ 2008-07-22 15:56 UTC (permalink / raw) To: a.zummo-BfzFCNDTiLLj+vYz1yj4TQ Cc: i2c-GZX6beZjE8VD60Wz+7aTrA, rtc-linux-/JYPxA39Uh5TLH3MbocFFw, Rod Whitby [-- Attachment #1.1: Type: text/plain, Size: 915 bytes --] Hi Alexander, On Wednesday 02 July 2008, Jean Delvare wrote: > On Wed, 2 Jul 2008 13:32:14 +0200, Laurent Pinchart wrote: > > Validating clients with black magic register checks doesn't make much sense > > for new-style i2c driver and has been known to fail on valid NXP pcf8563 chips. > > This patch removes the client validation code. > > > > Signed-off-by: Laurent Pinchart <laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org> > > --- > > drivers/rtc/rtc-pcf8563.c | 58 --------------------------------------------- > > 1 files changed, 0 insertions(+), 58 deletions(-) > > (...) > > Acked-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> Could you please push the patch for inclusion in 2.6.27 ? Best regards, -- Laurent Pinchart CSE Semaphore Belgium Chaussee de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75 [-- Attachment #1.2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 197 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <200807221756.44738.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>]
* Re: [PATCH] rtc-pcf8563: Remove client validation [not found] ` <200807221756.44738.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org> @ 2008-07-22 16:21 ` Jon Smirl 0 siblings, 0 replies; 4+ messages in thread From: Jon Smirl @ 2008-07-22 16:21 UTC (permalink / raw) To: Laurent Pinchart Cc: a.zummo-BfzFCNDTiLLj+vYz1yj4TQ, i2c-GZX6beZjE8VD60Wz+7aTrA, rtc-linux-/JYPxA39Uh5TLH3MbocFFw, Rod Whitby On 7/22/08, Laurent Pinchart <laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org> wrote: > Hi Alexander, > > > On Wednesday 02 July 2008, Jean Delvare wrote: > > On Wed, 2 Jul 2008 13:32:14 +0200, Laurent Pinchart wrote: > > > Validating clients with black magic register checks doesn't make much sense > > > for new-style i2c driver and has been known to fail on valid NXP pcf8563 chips. > > > This patch removes the client validation code. I've hit this same problem with the rtc8564. When the chips are first installed the registers haven't been initialized. This check makes the driver load fail which prevents the user space clock app from running and initializing the registers. The work around was to set the initial time from uboot. -- Jon Smirl jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org _______________________________________________ i2c mailing list i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org http://lists.lm-sensors.org/mailman/listinfo/i2c ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-22 16:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02 11:32 [PATCH] rtc-pcf8563: Remove client validation Laurent Pinchart
[not found] ` <200807021332.15495.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>
2008-07-02 11:34 ` Jean Delvare
[not found] ` <20080702133457.05a75e7c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-07-22 15:56 ` Laurent Pinchart
[not found] ` <200807221756.44738.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>
2008-07-22 16:21 ` Jon Smirl
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox