Lines Matching +full:slave +full:- +full:kernel

1 // SPDX-License-Identifier: GPL-2.0-or-later
10 #include <linux/kernel.h>
35 * In case the parasite power-detection is not working (seems to be the case
40 * - strong_pullup = 0 Disable strong pullup completely
41 * - strong_pullup = 1 Enable automatic strong pullup detection
42 * - strong_pullup = 2 Force strong pullup
66 #define MIN_TEMP -55 /* min temperature that can be measured */
98 * return a pointer on the slave w1_therm_family_converter struct:
102 (((struct w1_therm_family_data *)(sl->family_data))->specific_functions)
105 * return the power mode of the sl slave : 1-ext, 0-parasite, <0 unknown
109 (((struct w1_therm_family_data *)(sl->family_data))->external_powered)
112 * return the resolution in bit of the sl slave : <0 unknown
116 (((struct w1_therm_family_data *)(sl->family_data))->resolution)
119 * return the conv_time_override of the sl slave
123 (((struct w1_therm_family_data *)(sl->family_data))->conv_time_override)
126 * return the features of the sl slave
130 (((struct w1_therm_family_data *)(sl->family_data))->features)
133 * return whether or not a converT command has been issued to the slave
135 * * -1: conversion is in progress
139 (((struct w1_therm_family_data *)(sl->family_data))->convert_triggered)
143 (&((struct w1_therm_family_data *)family_data)->refcnt)
148 * struct w1_therm_family_converter - bind device specific functions
149 * @broken: flag for non-registred families
172 * struct w1_therm_family_data - device data
177 * -x error or undefined
181 * @features: bit mask - enable temperature validity check, poll for completion
196 * struct therm_info - store temperature reading
210 * reset_select_slave() - reset and select a slave
211 * @sl: the slave to select
213 * Resets the bus and select the slave by sending a ROM MATCH cmd
216 * At the beginning of the such process, sl->master->slave_count is 1 even if
221 * Return: 0 if success, negative kernel error code otherwise.
226 * convert_t() - Query the device for temperature conversion and read
227 * @sl: pointer to the slave to read
230 * Return: 0 if success, -kernel error code otherwise
235 * read_scratchpad() - read the data in device RAM
236 * @sl: pointer to the slave to read
239 * Return: 0 if success, -kernel error code otherwise
244 * write_scratchpad() - write nb_bytes in the device RAM
245 * @sl: pointer to the slave to write in
249 * Return: 0 if success, -kernel error code otherwise
254 * copy_scratchpad() - Copy the content of scratchpad in device EEPROM
255 * @sl: slave involved
257 * Return: 0 if success, -kernel error code otherwise
262 * recall_eeprom() - Restore EEPROM data to device RAM
263 * @sl: slave involved
265 * Return: 0 if success, -kernel error code otherwise
270 * read_powermode() - Query the power mode of the slave
271 * @sl: slave to retrieve the power mode
279 * * <0 kernel error code
284 * trigger_bulk_read() - function to trigger a bulk read on the bus
288 * It also set the status flag in each slave &struct w1_therm_family_data
291 * Return: 0 if success, -kernel error code otherwise
363 * w1_therm_add_slave() - Called when a new slave is discovered
364 * @sl: slave just discovered by the master.
366 * Called by the master when the slave is discovered on the bus. Used to
367 * initialize slave state before the beginning of any communication.
369 * Return: 0 - If success, negative kernel code otherwise
374 * w1_therm_remove_slave() - Called when a slave is removed
375 * @sl: slave to be removed.
377 * Called by the master when the slave is considered not to be on the bus
443 return -EOPNOTSUPP; in w1_read()
532 if (!sl->family_data) in w1_DS18B20_convert_time()
533 return -ENODEV; /* device unknown */ in w1_DS18B20_convert_time()
558 ret = 1600; /* GX20MH01 only. Datasheet says 1000ms - not enough */ in w1_DS18B20_convert_time()
568 if (!sl->family_data) in w1_DS18S20_convert_time()
569 return -ENODEV; /* device unknown */ in w1_DS18S20_convert_time()
581 if (!sl->family_data) in w1_DS1825_convert_time()
582 return -ENODEV; /* device unknown */ in w1_DS1825_convert_time()
634 return -EINVAL; in w1_DS18B20_set_resolution()
637 val = (val - W1_THERM_RESOLUTION_MIN) << W1_THERM_RESOLUTION_SHIFT; in w1_DS18B20_set_resolution()
670 return -EIO; in w1_DS18B20_set_resolution()
698 * w1_DS18B20_convert_temp() - temperature computation for DS18B20
710 /* Signed 16-bit value to unsigned, cpu order */ in w1_DS18B20_convert_temp()
713 /* Config register bit R2 = 1 - GX20MH01 in 13 or 14 bit resolution mode */ in w1_DS18B20_convert_temp()
718 t = (s16) bv; /* Degrees, lowest bit is 2^-6 */ in w1_DS18B20_convert_temp()
719 return (int)t * 1000 / 64; /* Sign-extend to int; millidegrees */ in w1_DS18B20_convert_temp()
721 t = (s16)bv; /* Degrees, lowest bit is 2^-4 */ in w1_DS18B20_convert_temp()
722 return (int)t * 1000 / 16; /* Sign-extend to int; millidegrees */ in w1_DS18B20_convert_temp()
726 * w1_DS18S20_convert_temp() - temperature computation for DS18S20
745 t = 1000*(-1*(s32)(0x100-rom[0]) >> 1); in w1_DS18S20_convert_temp()
747 t -= 250; in w1_DS18S20_convert_temp()
748 h = 1000*((s32)rom[7] - (s32)rom[6]); in w1_DS18S20_convert_temp()
756 * w1_DS1825_convert_temp() - temperature computation for DS1825
770 /* Signed 16-bit value to unsigned, cpu order */ in w1_DS1825_convert_temp()
773 /* Config register bit 7 = 1 - MA31850 found, 14 bit resolution */ in w1_DS1825_convert_temp()
777 bv = (bv & 0xFFFC); /* Degrees, lowest 4 bits are 2^-1, 2^-2 and 2 zero bits */ in w1_DS1825_convert_temp()
779 t = (s16)bv; /* Degrees, lowest bit is 2^-4 */ in w1_DS1825_convert_temp()
780 return (int)t * 1000 / 16; /* Sign-extend to int; millidegrees */ in w1_DS1825_convert_temp()
839 * device_family() - Retrieve a pointer on &struct w1_therm_family_converter
840 * @sl: slave to retrieve the device specific structure
850 if (w1_therm_families[i].f->fid == sl->family->fid) { in device_family()
859 * bus_mutex_lock() - Acquire the mutex
877 max_trying--; in bus_mutex_lock()
887 * check_family_data() - Check if family data and specific functions are present
890 * Return: 0 - OK, negative value - error
894 if ((!sl->family_data) || (!SLAVE_SPECIFIC_FUNC(sl))) { in check_family_data()
895 dev_info(&sl->dev, in check_family_data()
897 return -EINVAL; /* No device family */ in check_family_data()
903 * bulk_read_support() - check if slave support bulk read
911 return SLAVE_SPECIFIC_FUNC(sl)->bulk_read; in bulk_read_support()
913 dev_info(&sl->dev, in bulk_read_support()
920 * conversion_time() - get the Tconv for the slave
924 * on the resolution setting. This helper function get the slave timing,
927 * Return: conversion time in ms, negative values are kernel error code
932 return SLAVE_SPECIFIC_FUNC(sl)->get_conversion_time(sl); in conversion_time()
934 dev_info(&sl->dev, in conversion_time()
937 return -ENODEV; /* No device family */ in conversion_time()
941 * temperature_from_RAM() - Convert the read info to temperature
943 * @rom: read value on the slave device RAM
952 return SLAVE_SPECIFIC_FUNC(sl)->convert(rom); in temperature_from_RAM()
954 dev_info(&sl->dev, in temperature_from_RAM()
961 * int_to_short() - Safe casting of int to short
986 sl->family_data = kzalloc(sizeof(struct w1_therm_family_data), in w1_therm_add_slave()
988 if (!sl->family_data) in w1_therm_add_slave()
989 return -ENOMEM; in w1_therm_add_slave()
991 atomic_set(THERM_REFCNT(sl->family_data), 1); in w1_therm_add_slave()
996 kfree(sl->family_data); in w1_therm_add_slave()
997 return -ENODEV; in w1_therm_add_slave()
1008 int err = device_create_file(&sl->master->dev, in w1_therm_add_slave()
1012 dev_warn(&sl->dev, in w1_therm_add_slave()
1025 dev_warn(&sl->dev, in w1_therm_add_slave()
1031 if (SLAVE_SPECIFIC_FUNC(sl)->get_resolution) { in w1_therm_add_slave()
1033 SLAVE_SPECIFIC_FUNC(sl)->get_resolution(sl); in w1_therm_add_slave()
1036 dev_warn(&sl->dev, in w1_therm_add_slave()
1050 int refcnt = atomic_sub_return(1, THERM_REFCNT(sl->family_data)); in w1_therm_remove_slave()
1053 bulk_read_device_counter--; in w1_therm_remove_slave()
1056 device_remove_file(&sl->master->dev, in w1_therm_remove_slave()
1062 refcnt = atomic_read(THERM_REFCNT(sl->family_data)); in w1_therm_remove_slave()
1064 kfree(sl->family_data); in w1_therm_remove_slave()
1065 sl->family_data = NULL; in w1_therm_remove_slave()
1070 /* Safe version of reset_select_slave - avoid using the one in w_io.c */
1074 u64 rn = le64_to_cpu(*((u64 *)&sl->reg_num)); in reset_select_slave()
1076 if (w1_reset_bus(sl->master)) in reset_select_slave()
1077 return -ENODEV; in reset_select_slave()
1080 w1_write_block(sl->master, match, 9); in reset_select_slave()
1086 * w1_poll_completion - Poll for operation completion, with timeout
1093 * Return: 0 - OK, negative error - timeout
1108 return -EIO; in w1_poll_completion()
1115 struct w1_master *dev_master = sl->master; in convert_t()
1118 int ret = -ENODEV; in convert_t()
1121 if (!sl->family_data) in convert_t()
1129 dev_warn(&sl->dev, in convert_t()
1138 memset(info->rom, 0, sizeof(info->rom)); in convert_t()
1140 /* prevent the slave from going away in sleep */ in convert_t()
1141 atomic_inc(THERM_REFCNT(sl->family_data)); in convert_t()
1143 if (!bus_mutex_lock(&dev_master->bus_mutex)) { in convert_t()
1144 ret = -EAGAIN; /* Didn't acquire the mutex */ in convert_t()
1148 while (max_trying-- && ret) { /* ret should be 0 */ in convert_t()
1150 info->verdict = 0; in convert_t()
1151 info->crc = 0; in convert_t()
1152 /* safe version to select slave */ in convert_t()
1165 ret = -EINTR; in convert_t()
1168 mutex_unlock(&dev_master->bus_mutex); in convert_t()
1173 dev_dbg(&sl->dev, "%s: Timeout\n", __func__); in convert_t()
1176 mutex_unlock(&dev_master->bus_mutex); in convert_t()
1179 mutex_unlock(&dev_master->bus_mutex); in convert_t()
1182 ret = -EINTR; in convert_t()
1191 (info->rom[6] == 0xC) && in convert_t()
1192 ((info->rom[1] == 0x5 && info->rom[0] == 0x50) || in convert_t()
1193 (info->rom[1] == 0x7 && info->rom[0] == 0xFF)) in convert_t()
1199 ret = -EIO; in convert_t()
1208 mutex_unlock(&dev_master->bus_mutex); in convert_t()
1210 atomic_dec(THERM_REFCNT(sl->family_data)); in convert_t()
1219 struct w1_master *dev_master = sl->master; in conv_time_measure()
1221 int ret = -ENODEV; in conv_time_measure()
1224 if (!sl->family_data) in conv_time_measure()
1233 return -EINVAL; in conv_time_measure()
1236 memset(info->rom, 0, sizeof(info->rom)); in conv_time_measure()
1238 /* prevent the slave from going away in sleep */ in conv_time_measure()
1239 atomic_inc(THERM_REFCNT(sl->family_data)); in conv_time_measure()
1241 if (!bus_mutex_lock(&dev_master->bus_mutex)) { in conv_time_measure()
1242 ret = -EAGAIN; /* Didn't acquire the mutex */ in conv_time_measure()
1246 while (max_trying-- && ret) { /* ret should be 0 */ in conv_time_measure()
1247 info->verdict = 0; in conv_time_measure()
1248 info->crc = 0; in conv_time_measure()
1249 /* safe version to select slave */ in conv_time_measure()
1259 dev_dbg(&sl->dev, "%s: Timeout\n", __func__); in conv_time_measure()
1264 *conv_time = jiffies_to_msecs(j_end-j_start)*12/10; in conv_time_measure()
1268 ret = -EIO; in conv_time_measure()
1271 mutex_unlock(&dev_master->bus_mutex); in conv_time_measure()
1278 mutex_unlock(&dev_master->bus_mutex); in conv_time_measure()
1280 atomic_dec(THERM_REFCNT(sl->family_data)); in conv_time_measure()
1287 struct w1_master *dev_master = sl->master; in read_scratchpad()
1289 int ret = -ENODEV; in read_scratchpad()
1291 info->verdict = 0; in read_scratchpad()
1293 if (!sl->family_data) in read_scratchpad()
1296 memset(info->rom, 0, sizeof(info->rom)); in read_scratchpad()
1298 /* prevent the slave from going away in sleep */ in read_scratchpad()
1299 atomic_inc(THERM_REFCNT(sl->family_data)); in read_scratchpad()
1301 if (!bus_mutex_lock(&dev_master->bus_mutex)) { in read_scratchpad()
1302 ret = -EAGAIN; /* Didn't acquire the mutex */ in read_scratchpad()
1306 while (max_trying-- && ret) { /* ret should be 0 */ in read_scratchpad()
1307 /* safe version to select slave */ in read_scratchpad()
1313 nb_bytes_read = w1_read_block(dev_master, info->rom, 9); in read_scratchpad()
1315 dev_warn(&sl->dev, in read_scratchpad()
1318 ret = -EIO; in read_scratchpad()
1321 info->crc = w1_calc_crc8(info->rom, 8); in read_scratchpad()
1323 if (info->rom[8] == info->crc) { in read_scratchpad()
1324 info->verdict = 1; in read_scratchpad()
1327 ret = -EIO; /* CRC not checked */ in read_scratchpad()
1331 mutex_unlock(&dev_master->bus_mutex); in read_scratchpad()
1334 atomic_dec(THERM_REFCNT(sl->family_data)); in read_scratchpad()
1341 struct w1_master *dev_master = sl->master; in write_scratchpad()
1343 int ret = -ENODEV; in write_scratchpad()
1345 if (!sl->family_data) in write_scratchpad()
1348 /* prevent the slave from going away in sleep */ in write_scratchpad()
1349 atomic_inc(THERM_REFCNT(sl->family_data)); in write_scratchpad()
1351 if (!bus_mutex_lock(&dev_master->bus_mutex)) { in write_scratchpad()
1352 ret = -EAGAIN; /* Didn't acquire the mutex */ in write_scratchpad()
1356 while (max_trying-- && ret) { /* ret should be 0 */ in write_scratchpad()
1357 /* safe version to select slave */ in write_scratchpad()
1364 mutex_unlock(&dev_master->bus_mutex); in write_scratchpad()
1367 atomic_dec(THERM_REFCNT(sl->family_data)); in write_scratchpad()
1374 struct w1_master *dev_master = sl->master; in copy_scratchpad()
1376 int t_write, ret = -ENODEV; in copy_scratchpad()
1379 if (!sl->family_data) in copy_scratchpad()
1387 /* prevent the slave from going away in sleep */ in copy_scratchpad()
1388 atomic_inc(THERM_REFCNT(sl->family_data)); in copy_scratchpad()
1390 if (!bus_mutex_lock(&dev_master->bus_mutex)) { in copy_scratchpad()
1391 ret = -EAGAIN; /* Didn't acquire the mutex */ in copy_scratchpad()
1395 while (max_trying-- && ret) { /* ret should be 0 */ in copy_scratchpad()
1396 /* safe version to select slave */ in copy_scratchpad()
1409 ret = -EINTR; in copy_scratchpad()
1419 mutex_unlock(&dev_master->bus_mutex); in copy_scratchpad()
1421 atomic_dec(THERM_REFCNT(sl->family_data)); in copy_scratchpad()
1428 struct w1_master *dev_master = sl->master; in recall_eeprom()
1430 int ret = -ENODEV; in recall_eeprom()
1432 if (!sl->family_data) in recall_eeprom()
1435 /* prevent the slave from going away in sleep */ in recall_eeprom()
1436 atomic_inc(THERM_REFCNT(sl->family_data)); in recall_eeprom()
1438 if (!bus_mutex_lock(&dev_master->bus_mutex)) { in recall_eeprom()
1439 ret = -EAGAIN; /* Didn't acquire the mutex */ in recall_eeprom()
1443 while (max_trying-- && ret) { /* ret should be 0 */ in recall_eeprom()
1444 /* safe version to select slave */ in recall_eeprom()
1453 mutex_unlock(&dev_master->bus_mutex); in recall_eeprom()
1456 atomic_dec(THERM_REFCNT(sl->family_data)); in recall_eeprom()
1463 struct w1_master *dev_master = sl->master; in read_powermode()
1465 int ret = -ENODEV; in read_powermode()
1467 if (!sl->family_data) in read_powermode()
1470 /* prevent the slave from going away in sleep */ in read_powermode()
1471 atomic_inc(THERM_REFCNT(sl->family_data)); in read_powermode()
1473 if (!bus_mutex_lock(&dev_master->bus_mutex)) { in read_powermode()
1474 ret = -EAGAIN; /* Didn't acquire the mutex */ in read_powermode()
1478 while ((max_trying--) && (ret < 0)) { in read_powermode()
1479 /* safe version to select slave */ in read_powermode()
1491 mutex_unlock(&dev_master->bus_mutex); in read_powermode()
1494 atomic_dec(THERM_REFCNT(sl->family_data)); in read_powermode()
1504 int ret = -ENODEV; in trigger_bulk_read()
1512 list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) { in trigger_bulk_read()
1513 if (!sl->family_data) in trigger_bulk_read()
1533 if (!bus_mutex_lock(&dev_master->bus_mutex)) { in trigger_bulk_read()
1534 ret = -EAGAIN; /* Didn't acquire the mutex */ in trigger_bulk_read()
1538 while ((max_trying--) && (ret < 0)) { /* ret should be either 0 */ in trigger_bulk_read()
1552 &dev_master->slist, w1_slave_entry) { in trigger_bulk_read()
1554 SLAVE_CONVERT_TRIGGERED(sl) = -1; in trigger_bulk_read()
1560 ret = -EINTR; in trigger_bulk_read()
1563 mutex_unlock(&dev_master->bus_mutex); in trigger_bulk_read()
1565 mutex_unlock(&dev_master->bus_mutex); in trigger_bulk_read()
1568 ret = -EINTR; in trigger_bulk_read()
1578 mutex_unlock(&dev_master->bus_mutex); in trigger_bulk_read()
1581 list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) { in trigger_bulk_read()
1596 u8 *family_data = sl->family_data; in w1_slave_show()
1623 c -= snprintf(buf + PAGE_SIZE - c, c, "%02x ", info.rom[i]); in w1_slave_show()
1624 c -= snprintf(buf + PAGE_SIZE - c, c, ": crc=%02x %s\n", in w1_slave_show()
1633 c -= snprintf(buf + PAGE_SIZE - c, c, "%02x ", in w1_slave_show()
1636 c -= snprintf(buf + PAGE_SIZE - c, c, "t=%d\n", in w1_slave_show()
1639 ret = PAGE_SIZE - c; in w1_slave_show()
1658 if ((!sl->family_data) || (!SLAVE_SPECIFIC_FUNC(sl))) { in w1_slave_store()
1667 if (SLAVE_SPECIFIC_FUNC(sl)->set_resolution) in w1_slave_store()
1668 ret = SLAVE_SPECIFIC_FUNC(sl)->set_resolution(sl, val); in w1_slave_store()
1672 dev_warn(device, "%s: Set resolution - error %d\n", __func__, ret); in w1_slave_store()
1677 /* Reset the conversion time to default - it depends on resolution */ in w1_slave_store()
1690 if ((!sl->family_data) || (!SLAVE_SPECIFIC_FUNC(sl))) { in temperature_show()
1726 if (!sl->family_data) { in ext_power_show()
1748 if ((!sl->family_data) || (!SLAVE_SPECIFIC_FUNC(sl))) { in resolution_show()
1755 SLAVE_RESOLUTION(sl) = SLAVE_SPECIFIC_FUNC(sl)->get_resolution(sl); in resolution_show()
1780 if ((!sl->family_data) || (!SLAVE_SPECIFIC_FUNC(sl))) { in resolution_store()
1792 ret = SLAVE_SPECIFIC_FUNC(sl)->set_resolution(sl, val); in resolution_store()
1808 int ret = -EINVAL; /* Invalid argument */ in eeprom_cmd_store()
1811 if (!strncmp(buf, EEPROM_CMD_WRITE, sizeof(EEPROM_CMD_WRITE)-1)) in eeprom_cmd_store()
1814 if (!strncmp(buf, EEPROM_CMD_READ, sizeof(EEPROM_CMD_READ)-1)) in eeprom_cmd_store()
1862 __func__, -ENOMEM); in alarms_store()
1872 "%s: error parsing args %d\n", __func__, -EINVAL); in alarms_store()
1890 "%s: error parsing args %d\n", __func__, -EINVAL); in alarms_store()
1910 * (th : byte 2 - tl: byte 3) in alarms_store()
1919 "%s: error reading from the slave device %d\n", in alarms_store()
1928 __func__, -ENODEV); in alarms_store()
1932 ret = SLAVE_SPECIFIC_FUNC(sl)->write_data(sl, new_config_register); in alarms_store()
1935 "%s: error writing to the slave device %d\n", in alarms_store()
1949 int ret = -EINVAL; /* Invalid argument */ in therm_bulk_read_store()
1953 sizeof(BULK_TRIGGER_CMD)-1)) in therm_bulk_read_store()
1971 list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) { in therm_bulk_read_show()
1972 if (sl->family_data) { in therm_bulk_read_show()
1974 if (SLAVE_CONVERT_TRIGGERED(sl) == -1) { in therm_bulk_read_show()
1975 ret = -1; in therm_bulk_read_show()
1993 if ((!sl->family_data) || (!SLAVE_SPECIFIC_FUNC(sl))) { in conv_time_show()
2008 return -EINVAL; in conv_time_store()
2011 return -ENODEV; in conv_time_store()
2017 return -EINVAL; in conv_time_store()
2024 return -EIO; in conv_time_store()
2035 if ((!sl->family_data) || (!SLAVE_SPECIFIC_FUNC(sl))) { in features_show()
2052 return -EINVAL; /* invalid number */ in features_store()
2054 if ((!sl->family_data) || (!SLAVE_SPECIFIC_FUNC(sl))) { in features_store()
2056 return -ENODEV; in features_store()
2060 return -EINVAL; in features_store()
2069 dev_warn(&sl->dev, in features_store()
2093 ret = -EIO; in w1_read_temp()
2101 ret = -EOPNOTSUPP; in w1_read_temp()
2130 mutex_lock(&sl->master->bus_mutex); in w1_seq_show()
2132 if (w1_reset_bus(sl->master)) in w1_seq_show()
2134 w1_write_8(sl->master, W1_SKIP_ROM); in w1_seq_show()
2135 w1_write_8(sl->master, W1_42_CHAIN); in w1_seq_show()
2136 w1_write_8(sl->master, W1_42_CHAIN_ON); in w1_seq_show()
2137 w1_write_8(sl->master, W1_42_CHAIN_ON_INV); in w1_seq_show()
2138 msleep(sl->master->pullup_duration); in w1_seq_show()
2141 ack = w1_read_8(sl->master); in w1_seq_show()
2147 if (w1_reset_bus(sl->master)) in w1_seq_show()
2150 w1_write_8(sl->master, W1_42_COND_READ); in w1_seq_show()
2151 w1_read_block(sl->master, (u8 *)&rn, 8); in w1_seq_show()
2153 if (reg_num->family == W1_42_FINISHED_BYTE) in w1_seq_show()
2155 if (sl->reg_num.id == reg_num->id) in w1_seq_show()
2158 if (w1_reset_bus(sl->master)) in w1_seq_show()
2162 w1_write_8(sl->master, W1_MATCH_ROM); in w1_seq_show()
2163 w1_write_block(sl->master, (u8 *)&rn, 8); in w1_seq_show()
2164 w1_write_8(sl->master, W1_42_CHAIN); in w1_seq_show()
2165 w1_write_8(sl->master, W1_42_CHAIN_DONE); in w1_seq_show()
2166 w1_write_8(sl->master, W1_42_CHAIN_DONE_INV); in w1_seq_show()
2169 ack = w1_read_8(sl->master); in w1_seq_show()
2175 if (w1_reset_bus(sl->master)) in w1_seq_show()
2177 w1_write_8(sl->master, W1_SKIP_ROM); in w1_seq_show()
2178 w1_write_8(sl->master, W1_42_CHAIN); in w1_seq_show()
2179 w1_write_8(sl->master, W1_42_CHAIN_OFF); in w1_seq_show()
2180 w1_write_8(sl->master, W1_42_CHAIN_OFF_INV); in w1_seq_show()
2183 ack = w1_read_8(sl->master); in w1_seq_show()
2186 mutex_unlock(&sl->master->bus_mutex); in w1_seq_show()
2188 c -= snprintf(buf + PAGE_SIZE - c, c, "%d\n", seq); in w1_seq_show()
2189 return PAGE_SIZE - c; in w1_seq_show()
2191 mutex_unlock(&sl->master->bus_mutex); in w1_seq_show()
2192 return -EIO; in w1_seq_show()
2221 MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, temperature family.");
2223 MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS18S20));
2224 MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS1822));
2225 MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS18B20));
2226 MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS1825));
2227 MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS28EA00));