aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/masters/w1-gpio.c2
-rw-r--r--drivers/w1/slaves/Kconfig6
-rw-r--r--drivers/w1/slaves/Makefile1
-rw-r--r--drivers/w1/slaves/w1_ds2433.c7
-rw-r--r--drivers/w1/slaves/w1_therm.c2
5 files changed, 15 insertions, 3 deletions
diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
index 9e1138a75e8b..a411702413d6 100644
--- a/drivers/w1/masters/w1-gpio.c
+++ b/drivers/w1/masters/w1-gpio.c
@@ -39,7 +39,7 @@ static u8 w1_gpio_read_bit(void *data)
39{ 39{
40 struct w1_gpio_platform_data *pdata = data; 40 struct w1_gpio_platform_data *pdata = data;
41 41
42 return gpio_get_value(pdata->pin); 42 return gpio_get_value(pdata->pin) ? 1 : 0;
43} 43}
44 44
45static int __init w1_gpio_probe(struct platform_device *pdev) 45static int __init w1_gpio_probe(struct platform_device *pdev)
diff --git a/drivers/w1/slaves/Kconfig b/drivers/w1/slaves/Kconfig
index 8d0b1fb1e52e..1f51366417b9 100644
--- a/drivers/w1/slaves/Kconfig
+++ b/drivers/w1/slaves/Kconfig
@@ -16,6 +16,12 @@ config W1_SLAVE_SMEM
16 Say Y here if you want to connect 1-wire 16 Say Y here if you want to connect 1-wire
17 simple 64bit memory rom(ds2401/ds2411/ds1990*) to your wire. 17 simple 64bit memory rom(ds2401/ds2411/ds1990*) to your wire.
18 18
19config W1_SLAVE_DS2431
20 tristate "1kb EEPROM family support (DS2431)"
21 help
22 Say Y here if you want to use a 1-wire
23 1kb EEPROM family device (DS2431)
24
19config W1_SLAVE_DS2433 25config W1_SLAVE_DS2433
20 tristate "4kb EEPROM family support (DS2433)" 26 tristate "4kb EEPROM family support (DS2433)"
21 help 27 help
diff --git a/drivers/w1/slaves/Makefile b/drivers/w1/slaves/Makefile
index 990f400b6d22..f1f51f19b129 100644
--- a/drivers/w1/slaves/Makefile
+++ b/drivers/w1/slaves/Makefile
@@ -4,6 +4,7 @@
4 4
5obj-$(CONFIG_W1_SLAVE_THERM) += w1_therm.o 5obj-$(CONFIG_W1_SLAVE_THERM) += w1_therm.o
6obj-$(CONFIG_W1_SLAVE_SMEM) += w1_smem.o 6obj-$(CONFIG_W1_SLAVE_SMEM) += w1_smem.o
7obj-$(CONFIG_W1_SLAVE_DS2431) += w1_ds2431.o
7obj-$(CONFIG_W1_SLAVE_DS2433) += w1_ds2433.o 8obj-$(CONFIG_W1_SLAVE_DS2433) += w1_ds2433.o
8obj-$(CONFIG_W1_SLAVE_DS2760) += w1_ds2760.o 9obj-$(CONFIG_W1_SLAVE_DS2760) += w1_ds2760.o
9obj-$(CONFIG_W1_SLAVE_BQ27000) += w1_bq27000.o 10obj-$(CONFIG_W1_SLAVE_BQ27000) += w1_bq27000.o
diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c
index 858c16a544c2..139447148822 100644
--- a/drivers/w1/slaves/w1_ds2433.c
+++ b/drivers/w1/slaves/w1_ds2433.c
@@ -156,6 +156,9 @@ out_up:
156 */ 156 */
157static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data) 157static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data)
158{ 158{
159#ifdef CONFIG_W1_SLAVE_DS2433_CRC
160 struct w1_f23_data *f23 = sl->family_data;
161#endif
159 u8 wrbuf[4]; 162 u8 wrbuf[4];
160 u8 rdbuf[W1_PAGE_SIZE + 3]; 163 u8 rdbuf[W1_PAGE_SIZE + 3];
161 u8 es = (addr + len - 1) & 0x1f; 164 u8 es = (addr + len - 1) & 0x1f;
@@ -196,7 +199,9 @@ static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data)
196 199
197 /* Reset the bus to wake up the EEPROM (this may not be needed) */ 200 /* Reset the bus to wake up the EEPROM (this may not be needed) */
198 w1_reset_bus(sl->master); 201 w1_reset_bus(sl->master);
199 202#ifdef CONFIG_W1_SLAVE_DS2433_CRC
203 f23->validcrc &= ~(1 << (addr >> W1_PAGE_BITS));
204#endif
200 return 0; 205 return 0;
201} 206}
202 207
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 2c8dff9f77da..1ed3d554e372 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -115,7 +115,7 @@ static struct w1_therm_family_converter w1_therm_families[] = {
115 115
116static inline int w1_DS18B20_convert_temp(u8 rom[9]) 116static inline int w1_DS18B20_convert_temp(u8 rom[9])
117{ 117{
118 s16 t = (rom[1] << 8) | rom[0]; 118 int t = ((s16)rom[1] << 8) | rom[0];
119 t = t*1000/16; 119 t = t*1000/16;
120 return t; 120 return t;
121} 121}