Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] W1: Move w1 bus master code into 'w1/masters' and move w1 slave code into 'w1/slaves'

Signed-off-by: Ben Gardner <bgardner@wabtec.com>
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Evgeniy Polyakov and committed by
Greg Kroah-Hartman
bd529cfb ccd69940

+126 -91
+2 -58
drivers/w1/Kconfig
··· 11 11 This W1 support can also be built as a module. If so, the module 12 12 will be called wire.ko. 13 13 14 - config W1_MATROX 15 - tristate "Matrox G400 transport layer for 1-wire" 16 - depends on W1 && PCI 17 - help 18 - Say Y here if you want to communicate with your 1-wire devices 19 - using Matrox's G400 GPIO pins. 20 - 21 - This support is also available as a module. If so, the module 22 - will be called matrox_w1.ko. 23 - 24 - config W1_DS9490 25 - tristate "DS9490R transport layer driver" 26 - depends on W1 && USB 27 - help 28 - Say Y here if you want to have a driver for DS9490R UWB <-> W1 bridge. 29 - 30 - This support is also available as a module. If so, the module 31 - will be called ds9490r.ko. 32 - 33 - config W1_DS9490_BRIDGE 34 - tristate "DS9490R USB <-> W1 transport layer for 1-wire" 35 - depends on W1_DS9490 36 - help 37 - Say Y here if you want to communicate with your 1-wire devices 38 - using DS9490R USB bridge. 39 - 40 - This support is also available as a module. If so, the module 41 - will be called ds_w1_bridge.ko. 42 - 43 - config W1_THERM 44 - tristate "Thermal family implementation" 45 - depends on W1 46 - help 47 - Say Y here if you want to connect 1-wire thermal sensors to you 48 - wire. 49 - 50 - config W1_SMEM 51 - tristate "Simple 64bit memory family implementation" 52 - depends on W1 53 - help 54 - Say Y here if you want to connect 1-wire 55 - simple 64bit memory rom(ds2401/ds2411/ds1990*) to you wire. 56 - 57 - config W1_DS2433 58 - tristate "4kb EEPROM family support (DS2433)" 59 - depends on W1 60 - help 61 - Say Y here if you want to use a 1-wire 62 - 4kb EEPROM family device (DS2433). 63 - 64 - config W1_DS2433_CRC 65 - bool "Protect DS2433 data with a CRC16" 66 - depends on W1_DS2433 67 - select CRC16 68 - help 69 - Say Y here to protect DS2433 data with a CRC16. 70 - Each block has 30 bytes of data and a two byte CRC16. 71 - Full block writes are only allowed if the CRC is valid. 14 + source drivers/w1/masters/Kconfig 15 + source drivers/w1/slaves/Kconfig 72 16 73 17 endmenu
+1 -9
drivers/w1/Makefile
··· 13 13 obj-$(CONFIG_W1) += wire.o 14 14 wire-objs := w1.o w1_int.o w1_family.o w1_netlink.o w1_io.o 15 15 16 - obj-$(CONFIG_W1_MATROX) += matrox_w1.o 17 - obj-$(CONFIG_W1_THERM) += w1_therm.o 18 - obj-$(CONFIG_W1_SMEM) += w1_smem.o 16 + obj-y += masters/ slaves/ 19 17 20 - obj-$(CONFIG_W1_DS9490) += ds9490r.o 21 - ds9490r-objs := dscore.o 22 - 23 - obj-$(CONFIG_W1_DS9490_BRIDGE) += ds_w1_bridge.o 24 - 25 - obj-$(CONFIG_W1_DS2433) += w1_ds2433.o
+2 -2
drivers/w1/ds_w1_bridge.c drivers/w1/masters/ds_w1_bridge.c
··· 22 22 #include <linux/module.h> 23 23 #include <linux/types.h> 24 24 25 - #include "../w1/w1.h" 26 - #include "../w1/w1_int.h" 25 + #include "../w1.h" 26 + #include "../w1_int.h" 27 27 #include "dscore.h" 28 28 29 29 static struct ds_device *ds_dev;
+2 -2
drivers/w1/dscore.c drivers/w1/masters/dscore.c
··· 340 340 return -EIO; 341 341 } 342 342 #endif 343 - 343 + 344 344 return 0; 345 345 } 346 346 ··· 348 348 int ds_set_speed(struct ds_device *dev, int speed) 349 349 { 350 350 int err; 351 - 351 + 352 352 if (speed != SPEED_NORMAL && speed != SPEED_FLEXIBLE && speed != SPEED_OVERDRIVE) 353 353 return -EINVAL; 354 354
drivers/w1/dscore.h drivers/w1/masters/dscore.h
+38
drivers/w1/masters/Kconfig
··· 1 + # 2 + # 1-wire bus master configuration 3 + # 4 + 5 + menu "1-wire Bus Masters" 6 + depends on W1 7 + 8 + config W1_MASTER_MATROX 9 + tristate "Matrox G400 transport layer for 1-wire" 10 + depends on W1 && PCI 11 + help 12 + Say Y here if you want to communicate with your 1-wire devices 13 + using Matrox's G400 GPIO pins. 14 + 15 + This support is also available as a module. If so, the module 16 + will be called matrox_w1.ko. 17 + 18 + config W1_MASTER_DS9490 19 + tristate "DS9490R transport layer driver" 20 + depends on W1 && USB 21 + help 22 + Say Y here if you want to have a driver for DS9490R UWB <-> W1 bridge. 23 + 24 + This support is also available as a module. If so, the module 25 + will be called ds9490r.ko. 26 + 27 + config W1_MASTER_DS9490_BRIDGE 28 + tristate "DS9490R USB <-> W1 transport layer for 1-wire" 29 + depends on W1_DS9490 30 + help 31 + Say Y here if you want to communicate with your 1-wire devices 32 + using DS9490R USB bridge. 33 + 34 + This support is also available as a module. If so, the module 35 + will be called ds_w1_bridge.ko. 36 + 37 + endmenu 38 +
+11
drivers/w1/masters/Makefile
··· 1 + # 2 + # Makefile for 1-wire bus master drivers. 3 + # 4 + 5 + obj-$(CONFIG_W1_MASTER_MATROX) += matrox_w1.o 6 + 7 + obj-$(CONFIG_W1_MASTER_DS9490) += ds9490r.o 8 + ds9490r-objs := dscore.o 9 + 10 + obj-$(CONFIG_W1_MASTER_DS9490_BRIDGE) += ds_w1_bridge.o 11 +
+4 -4
drivers/w1/matrox_w1.c drivers/w1/masters/matrox_w1.c
··· 19 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 */ 21 21 22 - #include <asm/atomic.h> 23 22 #include <asm/types.h> 23 + #include <asm/atomic.h> 24 24 #include <asm/io.h> 25 25 26 26 #include <linux/delay.h> ··· 35 35 #include <linux/pci.h> 36 36 #include <linux/timer.h> 37 37 38 - #include "w1.h" 39 - #include "w1_int.h" 40 - #include "w1_log.h" 38 + #include "../w1.h" 39 + #include "../w1_int.h" 40 + #include "../w1_log.h" 41 41 42 42 MODULE_LICENSE("GPL"); 43 43 MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
+38
drivers/w1/slaves/Kconfig
··· 1 + # 2 + # 1-wire slaves configuration 3 + # 4 + 5 + menu "1-wire Slaves" 6 + depends on W1 7 + 8 + config W1_SLAVE_THERM 9 + tristate "Thermal family implementation" 10 + depends on W1 11 + help 12 + Say Y here if you want to connect 1-wire thermal sensors to you 13 + wire. 14 + 15 + config W1_SLAVE_SMEM 16 + tristate "Simple 64bit memory family implementation" 17 + depends on W1 18 + help 19 + Say Y here if you want to connect 1-wire 20 + simple 64bit memory rom(ds2401/ds2411/ds1990*) to you wire. 21 + 22 + config W1_SLAVE_DS2433 23 + tristate "4kb EEPROM family support (DS2433)" 24 + depends on W1 25 + help 26 + Say Y here if you want to use a 1-wire 27 + 4kb EEPROM family device (DS2433). 28 + 29 + config W1_SLAVE_DS2433_CRC 30 + bool "Protect DS2433 data with a CRC16" 31 + depends on W1_DS2433 32 + select CRC16 33 + help 34 + Say Y here to protect DS2433 data with a CRC16. 35 + Each block has 30 bytes of data and a two byte CRC16. 36 + Full block writes are only allowed if the CRC is valid. 37 + 38 + endmenu
+12
drivers/w1/slaves/Makefile
··· 1 + # 2 + # Makefile for the Dallas's 1-wire slaves. 3 + # 4 + 5 + ifeq ($(CONFIG_W1_SLAVE_DS2433_CRC), y) 6 + EXTRA_CFLAGS += -DCONFIG_W1_F23_CRC 7 + endif 8 + 9 + obj-$(CONFIG_W1_SLAVE_THERM) += w1_therm.o 10 + obj-$(CONFIG_W1_SLAVE_SMEM) += w1_smem.o 11 + obj-$(CONFIG_W1_SLAVE_DS2433) += w1_ds2433.o 12 +
+4 -4
drivers/w1/w1_ds2433.c drivers/w1/slaves/w1_ds2433.c
··· 21 21 22 22 #endif 23 23 24 - #include "w1.h" 25 - #include "w1_io.h" 26 - #include "w1_int.h" 27 - #include "w1_family.h" 24 + #include "../w1.h" 25 + #include "../w1_io.h" 26 + #include "../w1_int.h" 27 + #include "../w1_family.h" 28 28 29 29 MODULE_LICENSE("GPL"); 30 30 MODULE_AUTHOR("Ben Gardner <bgardner@wabtec.com>");
+5 -5
drivers/w1/w1_smem.c drivers/w1/slaves/w1_smem.c
··· 27 27 #include <linux/device.h> 28 28 #include <linux/types.h> 29 29 30 - #include "w1.h" 31 - #include "w1_io.h" 32 - #include "w1_int.h" 33 - #include "w1_family.h" 30 + #include "../w1.h" 31 + #include "../w1_io.h" 32 + #include "../w1_int.h" 33 + #include "../w1_family.h" 34 34 35 35 MODULE_LICENSE("GPL"); 36 36 MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>"); ··· 51 51 err = w1_register_family(&w1_smem_family_01); 52 52 if (err) 53 53 return err; 54 - 54 + 55 55 err = w1_register_family(&w1_smem_family_81); 56 56 if (err) { 57 57 w1_unregister_family(&w1_smem_family_01);
+7 -7
drivers/w1/w1_therm.c drivers/w1/slaves/w1_therm.c
··· 28 28 #include <linux/types.h> 29 29 #include <linux/delay.h> 30 30 31 - #include "w1.h" 32 - #include "w1_io.h" 33 - #include "w1_int.h" 34 - #include "w1_family.h" 31 + #include "../w1.h" 32 + #include "../w1_io.h" 33 + #include "../w1_int.h" 34 + #include "../w1_family.h" 35 35 36 36 MODULE_LICENSE("GPL"); 37 37 MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>"); ··· 123 123 124 124 if (!rom[7]) 125 125 return 0; 126 - 126 + 127 127 if (rom[1] == 0) 128 128 t = ((s32)rom[0] >> 1)*1000; 129 129 else 130 130 t = 1000*(-1*(s32)(0x100-rom[0]) >> 1); 131 - 131 + 132 132 t -= 250; 133 133 h = 1000*((s32)rom[7] - (s32)rom[6]); 134 134 h /= (s32)rom[7]; ··· 231 231 232 232 for (i = 0; i < 9; ++i) 233 233 count += sprintf(buf + count, "%02x ", sl->rom[i]); 234 - 234 + 235 235 count += sprintf(buf + count, "t=%d\n", w1_convert_temp(rom, sl->family->fid)); 236 236 out: 237 237 up(&dev->mutex);