mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 09:20:17 +00:00
W1: ds2490.c magic number work
This replaces some magic numbers with marcos and corrects one marco. Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
e464af2473
commit
19e7184f75
@ -88,7 +88,7 @@
|
|||||||
#define COMM_DT 0x2000
|
#define COMM_DT 0x2000
|
||||||
#define COMM_SPU 0x1000
|
#define COMM_SPU 0x1000
|
||||||
#define COMM_F 0x0800
|
#define COMM_F 0x0800
|
||||||
#define COMM_NTP 0x0400
|
#define COMM_NTF 0x0400
|
||||||
#define COMM_ICP 0x0200
|
#define COMM_ICP 0x0200
|
||||||
#define COMM_RST 0x0100
|
#define COMM_RST 0x0100
|
||||||
|
|
||||||
@ -440,7 +440,7 @@ static int ds_wait_status(struct ds_device *dev, struct ds_status *st)
|
|||||||
printk("\n");
|
printk("\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} while(!(buf[0x08] & 0x20) && !(err < 0) && ++count < 100);
|
} while (!(buf[0x08] & ST_IDLE) && !(err < 0) && ++count < 100);
|
||||||
|
|
||||||
if (err >= 16 && st->status & ST_EPOF) {
|
if (err >= 16 && st->status & ST_EPOF) {
|
||||||
printk(KERN_INFO "Resetting device after ST_EPOF.\n");
|
printk(KERN_INFO "Resetting device after ST_EPOF.\n");
|
||||||
@ -470,8 +470,16 @@ static int ds_reset(struct ds_device *dev)
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
//err = ds_send_control(dev, COMM_1_WIRE_RESET | COMM_F | COMM_IM | COMM_SE, SPEED_FLEXIBLE);
|
/* Other potentionally interesting flags for reset.
|
||||||
err = ds_send_control(dev, 0x43, SPEED_NORMAL);
|
*
|
||||||
|
* COMM_NTF: Return result register feedback. This could be used to
|
||||||
|
* detect some conditions such as short, alarming presence, or
|
||||||
|
* detect if a new device was detected.
|
||||||
|
*
|
||||||
|
* COMM_SE which allows SPEED_NORMAL, SPEED_FLEXIBLE, SPEED_OVERDRIVE:
|
||||||
|
* Select the data transfer rate.
|
||||||
|
*/
|
||||||
|
err = ds_send_control(dev, COMM_1_WIRE_RESET | COMM_IM, SPEED_NORMAL);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user