diff options
author | wdenk <wdenk> | 2003-06-27 21:31:46 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-06-27 21:31:46 +0000 |
commit | 8bde7f776c77b343aca29b8c7b58464d915ac245 (patch) | |
tree | 20f1fd99975215e7c658454a15cdb4ed4694e2d4 /drivers/ds1722.c | |
parent | 993cad9364c6b87ae429d1ed1130d8153f6f027e (diff) |
* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc.
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
* Patches by Kenneth Johansson, 25 Jun 2003:
- major rework of command structure
(work done mostly by Michal Cendrowski and Joakim Kristiansen)
Diffstat (limited to 'drivers/ds1722.c')
-rw-r--r-- | drivers/ds1722.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/ds1722.c b/drivers/ds1722.c index 34eb80ca23..227d8169a5 100644 --- a/drivers/ds1722.c +++ b/drivers/ds1722.c @@ -18,24 +18,24 @@ static void ds1722_select(int dev) u8 ds1722_read(int dev, int addr) { u8 res; - + ds1722_select(dev); - - ssi_tx_byte(addr); - res = ssi_rx_byte(); - + + ssi_tx_byte(addr); + res = ssi_rx_byte(); + ssi_chip_select(0); - + return res; } void ds1722_write(int dev, int addr, u8 data) { ds1722_select(dev); - - ssi_tx_byte(0x80|addr); - ssi_tx_byte(data); - + + ssi_tx_byte(0x80|addr); + ssi_tx_byte(data); + ssi_chip_select(0); } @@ -43,26 +43,26 @@ void ds1722_write(int dev, int addr, u8 data) u16 ds1722_temp(int dev, int resolution) { static int useconds[] = { - 75000, 150000, 300000, 600000, 1200000 + 75000, 150000, 300000, 600000, 1200000 }; char temp; u16 res; - - + + /* set up the desired resulotion ... */ ds1722_write(dev, 0, 0xe0 | (resolution << 1)); - + /* wait while the chip measures the tremperature */ - udelay(useconds[resolution]); - + udelay(useconds[resolution]); + res = (temp = ds1722_read(dev, 2)) << 8; - - if (temp < 0) { + + if (temp < 0) { temp = (16 - (ds1722_read(dev, 1) >> 4)) & 0x0f; } else { temp = (ds1722_read(dev, 1) >> 4); } - + switch (temp) { case 0: /* .0000 */ @@ -129,7 +129,7 @@ u16 ds1722_temp(int dev, int resolution) break; } return res; - + } int ds1722_probe(int dev) |