aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/w1/masters/ds2490.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
index 6fabf584395f..1b632d549e79 100644
--- a/drivers/w1/masters/ds2490.c
+++ b/drivers/w1/masters/ds2490.c
@@ -520,6 +520,7 @@ static int ds_touch_bit(struct ds_device *dev, u8 bit, u8 *tbit)
520 return 0; 520 return 0;
521} 521}
522 522
523#if 0
523static int ds_write_bit(struct ds_device *dev, u8 bit) 524static int ds_write_bit(struct ds_device *dev, u8 bit)
524{ 525{
525 int err; 526 int err;
@@ -538,6 +539,7 @@ static int ds_write_bit(struct ds_device *dev, u8 bit)
538 539
539 return 0; 540 return 0;
540} 541}
542#endif
541 543
542static int ds_write_byte(struct ds_device *dev, u8 byte) 544static int ds_write_byte(struct ds_device *dev, u8 byte)
543{ 545{
@@ -722,6 +724,7 @@ static u8 ds9490r_touch_bit(void *data, u8 bit)
722 return ret; 724 return ret;
723} 725}
724 726
727#if 0
725static void ds9490r_write_bit(void *data, u8 bit) 728static void ds9490r_write_bit(void *data, u8 bit)
726{ 729{
727 struct ds_device *dev = data; 730 struct ds_device *dev = data;
@@ -729,13 +732,6 @@ static void ds9490r_write_bit(void *data, u8 bit)
729 ds_write_bit(dev, bit); 732 ds_write_bit(dev, bit);
730} 733}
731 734
732static void ds9490r_write_byte(void *data, u8 byte)
733{
734 struct ds_device *dev = data;
735
736 ds_write_byte(dev, byte);
737}
738
739static u8 ds9490r_read_bit(void *data) 735static u8 ds9490r_read_bit(void *data)
740{ 736{
741 struct ds_device *dev = data; 737 struct ds_device *dev = data;
@@ -748,6 +744,14 @@ static u8 ds9490r_read_bit(void *data)
748 744
749 return bit & 1; 745 return bit & 1;
750} 746}
747#endif
748
749static void ds9490r_write_byte(void *data, u8 byte)
750{
751 struct ds_device *dev = data;
752
753 ds_write_byte(dev, byte);
754}
751 755
752static u8 ds9490r_read_byte(void *data) 756static u8 ds9490r_read_byte(void *data)
753{ 757{
@@ -812,8 +816,15 @@ static int ds_w1_init(struct ds_device *dev)
812 816
813 dev->master.data = dev; 817 dev->master.data = dev;
814 dev->master.touch_bit = &ds9490r_touch_bit; 818 dev->master.touch_bit = &ds9490r_touch_bit;
819 /* read_bit and write_bit in w1_bus_master are expected to set and
820 * sample the line level. For write_bit that means it is expected to
821 * set it to that value and leave it there. ds2490 only supports an
822 * individual time slot at the lowest level. The requirement from
823 * pulling the bus state down to reading the state is 15us, something
824 * that isn't realistic on the USB bus anyway.
815 dev->master.read_bit = &ds9490r_read_bit; 825 dev->master.read_bit = &ds9490r_read_bit;
816 dev->master.write_bit = &ds9490r_write_bit; 826 dev->master.write_bit = &ds9490r_write_bit;
827 */
817 dev->master.read_byte = &ds9490r_read_byte; 828 dev->master.read_byte = &ds9490r_read_byte;
818 dev->master.write_byte = &ds9490r_write_byte; 829 dev->master.write_byte = &ds9490r_write_byte;
819 dev->master.read_block = &ds9490r_read_block; 830 dev->master.read_block = &ds9490r_read_block;