提交 a08e2d33 编写于 作者: D David Fries 提交者: Linus Torvalds

W1: ds2490.c disable bit read and write

Don't export read and write bit operations, they didn't work, they weren't
used, and they can't be made to work.  The one wire low level bit
operations expect to set high or low levels, the ds2490 hardware only
supports complete read or write time slots, better to just comment them
out.
Signed-off-by: NDavid Fries <david@fries.net>
Signed-off-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e1c86d22
...@@ -520,6 +520,7 @@ static int ds_touch_bit(struct ds_device *dev, u8 bit, u8 *tbit) ...@@ -520,6 +520,7 @@ static int ds_touch_bit(struct ds_device *dev, u8 bit, u8 *tbit)
return 0; return 0;
} }
#if 0
static int ds_write_bit(struct ds_device *dev, u8 bit) static int ds_write_bit(struct ds_device *dev, u8 bit)
{ {
int err; int err;
...@@ -538,6 +539,7 @@ static int ds_write_bit(struct ds_device *dev, u8 bit) ...@@ -538,6 +539,7 @@ static int ds_write_bit(struct ds_device *dev, u8 bit)
return 0; return 0;
} }
#endif
static int ds_write_byte(struct ds_device *dev, u8 byte) static int ds_write_byte(struct ds_device *dev, u8 byte)
{ {
...@@ -722,6 +724,7 @@ static u8 ds9490r_touch_bit(void *data, u8 bit) ...@@ -722,6 +724,7 @@ static u8 ds9490r_touch_bit(void *data, u8 bit)
return ret; return ret;
} }
#if 0
static void ds9490r_write_bit(void *data, u8 bit) static void ds9490r_write_bit(void *data, u8 bit)
{ {
struct ds_device *dev = data; struct ds_device *dev = data;
...@@ -729,13 +732,6 @@ static void ds9490r_write_bit(void *data, u8 bit) ...@@ -729,13 +732,6 @@ static void ds9490r_write_bit(void *data, u8 bit)
ds_write_bit(dev, bit); ds_write_bit(dev, bit);
} }
static void ds9490r_write_byte(void *data, u8 byte)
{
struct ds_device *dev = data;
ds_write_byte(dev, byte);
}
static u8 ds9490r_read_bit(void *data) static u8 ds9490r_read_bit(void *data)
{ {
struct ds_device *dev = data; struct ds_device *dev = data;
...@@ -748,6 +744,14 @@ static u8 ds9490r_read_bit(void *data) ...@@ -748,6 +744,14 @@ static u8 ds9490r_read_bit(void *data)
return bit & 1; return bit & 1;
} }
#endif
static void ds9490r_write_byte(void *data, u8 byte)
{
struct ds_device *dev = data;
ds_write_byte(dev, byte);
}
static u8 ds9490r_read_byte(void *data) static u8 ds9490r_read_byte(void *data)
{ {
...@@ -812,8 +816,15 @@ static int ds_w1_init(struct ds_device *dev) ...@@ -812,8 +816,15 @@ static int ds_w1_init(struct ds_device *dev)
dev->master.data = dev; dev->master.data = dev;
dev->master.touch_bit = &ds9490r_touch_bit; dev->master.touch_bit = &ds9490r_touch_bit;
/* read_bit and write_bit in w1_bus_master are expected to set and
* sample the line level. For write_bit that means it is expected to
* set it to that value and leave it there. ds2490 only supports an
* individual time slot at the lowest level. The requirement from
* pulling the bus state down to reading the state is 15us, something
* that isn't realistic on the USB bus anyway.
dev->master.read_bit = &ds9490r_read_bit; dev->master.read_bit = &ds9490r_read_bit;
dev->master.write_bit = &ds9490r_write_bit; dev->master.write_bit = &ds9490r_write_bit;
*/
dev->master.read_byte = &ds9490r_read_byte; dev->master.read_byte = &ds9490r_read_byte;
dev->master.write_byte = &ds9490r_write_byte; dev->master.write_byte = &ds9490r_write_byte;
dev->master.read_block = &ds9490r_read_block; dev->master.read_block = &ds9490r_read_block;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册