mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
w1: ds1wm: add a reset recovery parameter
This fixes a regression in 3.0 reported by Paul Parsons regarding the removal of the msleep(1) in the ds1wm_reset() function: : The linux-3.0-rc4 DS1WM 1-wire driver is logging "bus error, retrying" : error messages on an HP iPAQ hx4700 PDA (XScale-PXA270): : : <snip> : Driver for 1-wire Dallas network protocol. : DS1WM w1 busmaster driver - (c) 2004 Szabolcs Gyurko : 1-Wire driver for the DS2760 battery monitor chip - (c) 2004-2005, Szabolcs Gyurko : ds1wm ds1wm: pass: 1 bus error, retrying : ds1wm ds1wm: pass: 2 bus error, retrying : ds1wm ds1wm: pass: 3 bus error, retrying : ds1wm ds1wm: pass: 4 bus error, retrying : ds1wm ds1wm: pass: 5 bus error, retrying : ... : : The visible result is that the battery charging LED is erratic; sometimes : it works, mostly it doesn't. : : The linux-2.6.39 DS1WM 1-wire driver worked OK. I haven't tried 3.0-rc1, : 3.0-rc2, or 3.0-rc3. This sleep should not be required on normal circuitry provided the pull-ups on the bus are correctly adapted to the slaves. Unfortunately, this is not always the case. The sleep is restored but as a parameter to the probe function in the pdata. [[email protected]: coding-style fixes] Reported-by: Paul Parsons <[email protected]> Tested-by: Paul Parsons <[email protected]> Signed-off-by: Jean-François Dagenais <[email protected]> Cc: Evgeniy Polyakov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
453a9bf347
commit
f607e7fc5f
4 changed files with 14 additions and 0 deletions
|
|
@ -109,6 +109,7 @@ struct ds1wm_data {
|
|||
/* byte to write that makes all intr disabled, */
|
||||
/* considering active_state (IAS) (optimization) */
|
||||
u8 int_en_reg_none;
|
||||
unsigned int reset_recover_delay; /* see ds1wm.h */
|
||||
};
|
||||
|
||||
static inline void ds1wm_write_register(struct ds1wm_data *ds1wm_data, u32 reg,
|
||||
|
|
@ -187,6 +188,9 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (ds1wm_data->reset_recover_delay)
|
||||
msleep(ds1wm_data->reset_recover_delay);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -490,6 +494,7 @@ static int ds1wm_probe(struct platform_device *pdev)
|
|||
}
|
||||
ds1wm_data->irq = res->start;
|
||||
ds1wm_data->int_en_reg_none = (plat->active_high ? DS1WM_INTEN_IAS : 0);
|
||||
ds1wm_data->reset_recover_delay = plat->reset_recover_delay;
|
||||
|
||||
if (res->flags & IORESOURCE_IRQ_HIGHEDGE)
|
||||
irq_set_irq_type(ds1wm_data->irq, IRQ_TYPE_EDGE_RISING);
|
||||
|
|
|
|||
Loading…
Reference in a new issue