/drivers/net/slip/ |
D | slip.c | 104 static void slip_unesc(struct slip *sl, unsigned char c); 107 static void slip_unesc6(struct slip *sl, unsigned char c); 130 static int sl_alloc_bufs(struct slip *sl, int mtu) in sl_alloc_bufs() argument 171 spin_lock_bh(&sl->lock); in sl_alloc_bufs() 172 if (sl->tty == NULL) { in sl_alloc_bufs() 173 spin_unlock_bh(&sl->lock); in sl_alloc_bufs() 177 sl->mtu = mtu; in sl_alloc_bufs() 178 sl->buffsize = len; in sl_alloc_bufs() 179 sl->rcount = 0; in sl_alloc_bufs() 180 sl->xleft = 0; in sl_alloc_bufs() [all …]
|
/drivers/net/can/ |
D | slcan.c | 143 static void slc_bump(struct slcan *sl) in slc_bump() argument 149 char *cmd = sl->rbuff; in slc_bump() 159 cf.len = sl->rbuff[SLC_CMD_LEN + SLC_SFF_ID_LEN]; in slc_bump() 160 sl->rbuff[SLC_CMD_LEN + SLC_SFF_ID_LEN] = 0; in slc_bump() 170 cf.len = sl->rbuff[SLC_CMD_LEN + SLC_EFF_ID_LEN]; in slc_bump() 171 sl->rbuff[SLC_CMD_LEN + SLC_EFF_ID_LEN] = 0; in slc_bump() 179 if (kstrtou32(sl->rbuff + SLC_CMD_LEN, 16, &tmpid)) in slc_bump() 209 skb->dev = sl->dev; in slc_bump() 215 can_skb_prv(skb)->ifindex = sl->dev->ifindex; in slc_bump() 220 sl->dev->stats.rx_packets++; in slc_bump() [all …]
|
/drivers/w1/slaves/ |
D | w1_therm.c | 101 #define SLAVE_SPECIFIC_FUNC(sl) \ argument 102 (((struct w1_therm_family_data *)(sl->family_data))->specific_functions) 108 #define SLAVE_POWERMODE(sl) \ argument 109 (((struct w1_therm_family_data *)(sl->family_data))->external_powered) 115 #define SLAVE_RESOLUTION(sl) \ argument 116 (((struct w1_therm_family_data *)(sl->family_data))->resolution) 122 #define SLAVE_CONV_TIME_OVERRIDE(sl) \ argument 123 (((struct w1_therm_family_data *)(sl->family_data))->conv_time_override) 129 #define SLAVE_FEATURES(sl) \ argument 130 (((struct w1_therm_family_data *)(sl->family_data))->features) [all …]
|
D | w1_ds28e17.c | 85 static int w1_f19_i2c_busy_wait(struct w1_slave *sl, size_t count) in w1_f19_i2c_busy_wait() argument 88 struct w1_f19_data *data = sl->family_data; in w1_f19_i2c_busy_wait() 92 if (w1_touch_bit(sl->master, 1) == 0) in w1_f19_i2c_busy_wait() 108 if (w1_touch_bit(sl->master, 1) == 0) in w1_f19_i2c_busy_wait() 116 dev_warn(&sl->dev, "busy timeout\n"); in w1_f19_i2c_busy_wait() 122 static size_t w1_f19_error(struct w1_slave *sl, u8 w1_buf[]) in w1_f19_error() argument 126 dev_warn(&sl->dev, "crc16 mismatch\n"); in w1_f19_error() 128 dev_warn(&sl->dev, "i2c device not responding\n"); in w1_f19_error() 131 dev_warn(&sl->dev, "i2c short write, %d bytes not acknowledged\n", in w1_f19_error() 149 static int __w1_f19_i2c_write(struct w1_slave *sl, in __w1_f19_i2c_write() argument [all …]
|
D | w1_ds2438.c | 61 static int w1_ds2438_get_page(struct w1_slave *sl, int pageno, u8 *buf) in w1_ds2438_get_page() argument 71 if (w1_reset_select_slave(sl)) in w1_ds2438_get_page() 75 w1_write_block(sl->master, w1_buf, 2); in w1_ds2438_get_page() 77 if (w1_reset_select_slave(sl)) in w1_ds2438_get_page() 81 w1_write_block(sl->master, w1_buf, 2); in w1_ds2438_get_page() 83 count = w1_read_block(sl->master, buf, DS2438_PAGE_SIZE + 1); in w1_ds2438_get_page() 95 static int w1_ds2438_get_temperature(struct w1_slave *sl, int16_t *temperature) in w1_ds2438_get_temperature() argument 103 mutex_lock(&sl->master->bus_mutex); in w1_ds2438_get_temperature() 106 if (w1_reset_select_slave(sl)) in w1_ds2438_get_temperature() 108 w1_write_8(sl->master, W1_DS2438_CONVERT_TEMP); in w1_ds2438_get_temperature() [all …]
|
D | w1_ds2408.c | 38 static int _read_reg(struct w1_slave *sl, u8 address, unsigned char* buf) in _read_reg() argument 41 dev_dbg(&sl->dev, in _read_reg() 43 sl, (unsigned int)address, buf); in _read_reg() 48 mutex_lock(&sl->master->bus_mutex); in _read_reg() 49 dev_dbg(&sl->dev, "mutex locked"); in _read_reg() 51 if (w1_reset_select_slave(sl)) { in _read_reg() 52 mutex_unlock(&sl->master->bus_mutex); in _read_reg() 59 w1_write_block(sl->master, wrbuf, 3); in _read_reg() 60 *buf = w1_read_8(sl->master); in _read_reg() 62 mutex_unlock(&sl->master->bus_mutex); in _read_reg() [all …]
|
D | w1_ds28e04.c | 71 static int w1_f1C_refresh_block(struct w1_slave *sl, struct w1_f1C_data *data, in w1_f1C_refresh_block() argument 80 if (w1_reset_select_slave(sl)) { in w1_f1C_refresh_block() 88 w1_write_block(sl->master, wrbuf, 3); in w1_f1C_refresh_block() 89 w1_read_block(sl->master, &data->memory[off], W1_PAGE_SIZE); in w1_f1C_refresh_block() 98 static int w1_f1C_read(struct w1_slave *sl, int addr, int len, char *data) in w1_f1C_read() argument 103 if (w1_reset_select_slave(sl)) in w1_f1C_read() 110 w1_write_block(sl->master, wrbuf, sizeof(wrbuf)); in w1_f1C_read() 111 return w1_read_block(sl->master, data, len); in w1_f1C_read() 118 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_read() local 119 struct w1_f1C_data *data = sl->family_data; in eeprom_read() [all …]
|
D | w1_ds2433.c | 61 static int w1_f23_refresh_block(struct w1_slave *sl, struct w1_f23_data *data, in w1_f23_refresh_block() argument 70 if (w1_reset_select_slave(sl)) { in w1_f23_refresh_block() 78 w1_write_block(sl->master, wrbuf, 3); in w1_f23_refresh_block() 79 w1_read_block(sl->master, &data->memory[off], W1_PAGE_SIZE); in w1_f23_refresh_block() 93 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_read() local 95 struct w1_f23_data *data = sl->family_data; in eeprom_read() 104 mutex_lock(&sl->master->bus_mutex); in eeprom_read() 111 if (w1_f23_refresh_block(sl, data, i)) { in eeprom_read() 121 if (w1_reset_select_slave(sl)) { in eeprom_read() 129 w1_write_block(sl->master, wrbuf, 3); in eeprom_read() [all …]
|
D | w1_ds2805.c | 61 static int w1_f0d_readblock(struct w1_slave *sl, int off, int count, char *buf) in w1_f0d_readblock() argument 72 if (w1_reset_select_slave(sl)) in w1_f0d_readblock() 75 w1_write_block(sl->master, wrbuf, sizeof(wrbuf)); in w1_f0d_readblock() 76 w1_read_block(sl->master, buf, count); in w1_f0d_readblock() 78 if (w1_reset_select_slave(sl)) in w1_f0d_readblock() 81 w1_write_block(sl->master, wrbuf, sizeof(wrbuf)); in w1_f0d_readblock() 82 w1_read_block(sl->master, cmp, count); in w1_f0d_readblock() 88 dev_err(&sl->dev, "proof reading failed %d times\n", in w1_f0d_readblock() 98 struct w1_slave *sl = kobj_to_w1_slave(kobj); in w1_f0d_read_bin() local 105 mutex_lock(&sl->master->mutex); in w1_f0d_read_bin() [all …]
|
D | w1_ds2430.c | 65 static int w1_f14_readblock(struct w1_slave *sl, int off, int count, char *buf) in w1_f14_readblock() argument 75 if (w1_reset_select_slave(sl)) in w1_f14_readblock() 78 w1_write_block(sl->master, wrbuf, 2); in w1_f14_readblock() 79 w1_read_block(sl->master, buf, count); in w1_f14_readblock() 81 if (w1_reset_select_slave(sl)) in w1_f14_readblock() 84 w1_write_block(sl->master, wrbuf, 2); in w1_f14_readblock() 85 w1_read_block(sl->master, cmp, count); in w1_f14_readblock() 91 dev_err(&sl->dev, "proof reading failed %d times\n", in w1_f14_readblock() 101 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_read() local 108 mutex_lock(&sl->master->bus_mutex); in eeprom_read() [all …]
|
D | w1_ds250x.c | 40 int (*read)(struct w1_slave *sl, int pageno); 46 static int w1_ds2502_read_page(struct w1_slave *sl, int pageno) in w1_ds2502_read_page() argument 48 struct w1_eprom_data *data = sl->family_data; in w1_ds2502_read_page() 57 mutex_lock(&sl->master->bus_mutex); in w1_ds2502_read_page() 59 if (w1_reset_select_slave(sl)) in w1_ds2502_read_page() 65 w1_write_block(sl->master, buf, 3); in w1_ds2502_read_page() 67 crc8 = w1_read_8(sl->master); in w1_ds2502_read_page() 71 w1_read_block(sl->master, &data->eprom[pgoff], W1_PAGE_SIZE); in w1_ds2502_read_page() 73 crc8 = w1_read_8(sl->master); in w1_ds2502_read_page() 80 mutex_unlock(&sl->master->bus_mutex); in w1_ds2502_read_page() [all …]
|
D | w1_ds2413.c | 31 struct w1_slave *sl = kobj_to_w1_slave(kobj); in state_read() local 36 dev_dbg(&sl->dev, in state_read() 45 mutex_lock(&sl->master->bus_mutex); in state_read() 46 dev_dbg(&sl->dev, "mutex locked"); in state_read() 49 if (w1_reset_select_slave(sl)) in state_read() 53 w1_write_8(sl->master, W1_F3A_FUNC_PIO_ACCESS_READ); in state_read() 55 state = w1_read_8(sl->master); in state_read() 63 dev_warn(&sl->dev, "slave device did not respond to PIO_ACCESS_READ, " \ in state_read() 68 if (w1_reset_resume_command(sl->master)) in state_read() 71 dev_warn(&sl->dev, "PIO_ACCESS_READ error, retries left: %d\n", retries); in state_read() [all …]
|
D | w1_ds2431.c | 64 static int w1_f2d_readblock(struct w1_slave *sl, int off, int count, char *buf) in w1_f2d_readblock() argument 75 if (w1_reset_select_slave(sl)) in w1_f2d_readblock() 78 w1_write_block(sl->master, wrbuf, 3); in w1_f2d_readblock() 79 w1_read_block(sl->master, buf, count); in w1_f2d_readblock() 81 if (w1_reset_select_slave(sl)) in w1_f2d_readblock() 84 w1_write_block(sl->master, wrbuf, 3); in w1_f2d_readblock() 85 w1_read_block(sl->master, cmp, count); in w1_f2d_readblock() 91 dev_err(&sl->dev, "proof reading failed %d times\n", in w1_f2d_readblock() 101 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_read() local 108 mutex_lock(&sl->master->bus_mutex); in eeprom_read() [all …]
|
D | w1_ds2780.c | 29 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); in w1_ds2780_do_io() local 36 if (w1_reset_select_slave(sl) == 0) { in w1_ds2780_do_io() 38 w1_write_8(sl->master, W1_DS2780_WRITE_DATA); in w1_ds2780_do_io() 39 w1_write_8(sl->master, addr); in w1_ds2780_do_io() 40 w1_write_block(sl->master, buf, count); in w1_ds2780_do_io() 42 w1_write_8(sl->master, W1_DS2780_READ_DATA); in w1_ds2780_do_io() 43 w1_write_8(sl->master, addr); in w1_ds2780_do_io() 44 count = w1_read_block(sl->master, buf, count); in w1_ds2780_do_io() 54 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); in w1_ds2780_io() local 60 mutex_lock(&sl->master->bus_mutex); in w1_ds2780_io() [all …]
|
D | w1_ds2781.c | 26 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); in w1_ds2781_do_io() local 33 if (w1_reset_select_slave(sl) == 0) { in w1_ds2781_do_io() 35 w1_write_8(sl->master, W1_DS2781_WRITE_DATA); in w1_ds2781_do_io() 36 w1_write_8(sl->master, addr); in w1_ds2781_do_io() 37 w1_write_block(sl->master, buf, count); in w1_ds2781_do_io() 39 w1_write_8(sl->master, W1_DS2781_READ_DATA); in w1_ds2781_do_io() 40 w1_write_8(sl->master, addr); in w1_ds2781_do_io() 41 count = w1_read_block(sl->master, buf, count); in w1_ds2781_do_io() 51 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); in w1_ds2781_io() local 57 mutex_lock(&sl->master->bus_mutex); in w1_ds2781_io() [all …]
|
D | w1_ds2406.c | 31 struct w1_slave *sl = kobj_to_w1_slave(kobj); in w1_f12_read_state() local 41 mutex_lock(&sl->master->bus_mutex); in w1_f12_read_state() 43 if (w1_reset_select_slave(sl)) { in w1_f12_read_state() 44 mutex_unlock(&sl->master->bus_mutex); in w1_f12_read_state() 48 w1_write_block(sl->master, w1_buf, 3); in w1_f12_read_state() 49 w1_read_block(sl->master, w1_buf+3, 3); in w1_f12_read_state() 57 mutex_unlock(&sl->master->bus_mutex); in w1_f12_read_state() 67 struct w1_slave *sl = kobj_to_w1_slave(kobj); in w1_f12_write_output() local 76 mutex_lock(&sl->master->bus_mutex); in w1_f12_write_output() 78 if (w1_reset_select_slave(sl)) { in w1_f12_write_output() [all …]
|
D | w1_ds2405.c | 26 static int w1_ds2405_select(struct w1_slave *sl, bool only_active) in w1_ds2405_select() argument 28 struct w1_master *dev = sl->master; in w1_ds2405_select() 30 u64 dev_addr = le64_to_cpu(*(u64 *)&sl->reg_num); in w1_ds2405_select() 60 static int w1_ds2405_read_pio(struct w1_slave *sl) in w1_ds2405_read_pio() argument 62 if (w1_ds2405_select(sl, true)) in w1_ds2405_read_pio() 65 if (w1_ds2405_select(sl, false)) in w1_ds2405_read_pio() 74 struct w1_slave *sl = dev_to_w1_slave(device); in state_show() local 75 struct w1_master *dev = sl->master; in state_show() 85 if (!w1_ds2405_select(sl, false)) { in state_show() 111 struct w1_slave *sl = dev_to_w1_slave(device); in output_show() local [all …]
|
/drivers/base/regmap/ |
D | regmap-w1.c | 24 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); in w1_reg_a8_v8_read() local 30 mutex_lock(&sl->master->bus_mutex); in w1_reg_a8_v8_read() 31 if (!w1_reset_select_slave(sl)) { in w1_reg_a8_v8_read() 32 w1_write_8(sl->master, W1_CMD_READ_DATA); in w1_reg_a8_v8_read() 33 w1_write_8(sl->master, reg); in w1_reg_a8_v8_read() 34 *val = w1_read_8(sl->master); in w1_reg_a8_v8_read() 38 mutex_unlock(&sl->master->bus_mutex); in w1_reg_a8_v8_read() 46 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); in w1_reg_a8_v8_write() local 52 mutex_lock(&sl->master->bus_mutex); in w1_reg_a8_v8_write() 53 if (!w1_reset_select_slave(sl)) { in w1_reg_a8_v8_write() [all …]
|
/drivers/net/ethernet/ti/ |
D | cpsw_sl.c | 189 u32 cpsw_sl_reg_read(struct cpsw_sl *sl, enum cpsw_sl_regs reg) in cpsw_sl_reg_read() argument 193 if (sl->regs[reg] == CPSW_SL_REG_NOTUSED) { in cpsw_sl_reg_read() 194 dev_err(sl->dev, "cpsw_sl: not sup r reg: %04X\n", in cpsw_sl_reg_read() 195 sl->regs[reg]); in cpsw_sl_reg_read() 199 val = readl(sl->sl_base + sl->regs[reg]); in cpsw_sl_reg_read() 200 dev_dbg(sl->dev, "cpsw_sl: reg: %04X r 0x%08X\n", sl->regs[reg], val); in cpsw_sl_reg_read() 204 void cpsw_sl_reg_write(struct cpsw_sl *sl, enum cpsw_sl_regs reg, u32 val) in cpsw_sl_reg_write() argument 206 if (sl->regs[reg] == CPSW_SL_REG_NOTUSED) { in cpsw_sl_reg_write() 207 dev_err(sl->dev, "cpsw_sl: not sup w reg: %04X\n", in cpsw_sl_reg_write() 208 sl->regs[reg]); in cpsw_sl_reg_write() [all …]
|
D | cpsw_sl.h | 63 void cpsw_sl_reset(struct cpsw_sl *sl, unsigned long tmo); 65 u32 cpsw_sl_ctl_set(struct cpsw_sl *sl, u32 ctl_funcs); 66 u32 cpsw_sl_ctl_clr(struct cpsw_sl *sl, u32 ctl_funcs); 67 void cpsw_sl_ctl_reset(struct cpsw_sl *sl); 68 int cpsw_sl_wait_for_idle(struct cpsw_sl *sl, unsigned long tmo); 70 u32 cpsw_sl_reg_read(struct cpsw_sl *sl, enum cpsw_sl_regs reg); 71 void cpsw_sl_reg_write(struct cpsw_sl *sl, enum cpsw_sl_regs reg, u32 val);
|
/drivers/w1/ |
D | w1.c | 82 struct w1_slave *sl = dev_to_w1_slave(dev); in w1_slave_release() local 84 dev_dbg(dev, "%s: Releasing %s [%p]\n", __func__, sl->name, sl); in w1_slave_release() 86 w1_family_put(sl->family); in w1_slave_release() 87 sl->master->slave_count--; in w1_slave_release() 92 struct w1_slave *sl = dev_to_w1_slave(dev); in name_show() local 94 return sprintf(buf, "%s\n", sl->name); in name_show() 101 struct w1_slave *sl = dev_to_w1_slave(dev); in id_show() local 102 ssize_t count = sizeof(sl->reg_num); in id_show() 104 memcpy(buf, (u8 *)&sl->reg_num, count); in id_show() 122 struct w1_slave *sl = kobj_to_w1_slave(kobj); in rw_write() local [all …]
|
D | w1_netlink.c | 43 struct w1_slave *sl; member 267 struct w1_slave *sl; in w1_get_slaves() local 275 list_for_each_entry(sl, &dev->slist, w1_slave_entry) { in w1_get_slaves() 276 memcpy(&rn, &sl->reg_num, sizeof(rn)); in w1_get_slaves() 316 struct w1_slave *sl; in w1_process_command_addremove() local 325 sl = w1_slave_search_device(dev, id); in w1_process_command_addremove() 328 if (sl) in w1_process_command_addremove() 334 if (sl) in w1_process_command_addremove() 335 w1_slave_detach(sl); in w1_process_command_addremove() 387 static int w1_process_command_slave(struct w1_slave *sl, in w1_process_command_slave() argument [all …]
|
/drivers/media/dvb-core/ |
D | dvb_ca_en50221.c | 230 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_check_camstatus() local 237 return (atomic_read(&sl->camchange_count) != 0); in dvb_ca_en50221_check_camstatus() 245 int cam_present_old = (sl->slot_state != DVB_CA_SLOTSTATE_NONE); in dvb_ca_en50221_check_camstatus() 252 sl->camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED; in dvb_ca_en50221_check_camstatus() 254 sl->camchange_type = DVB_CA_EN50221_CAMCHANGE_INSERTED; in dvb_ca_en50221_check_camstatus() 255 atomic_set(&sl->camchange_count, 1); in dvb_ca_en50221_check_camstatus() 257 if ((sl->slot_state == DVB_CA_SLOTSTATE_WAITREADY) && in dvb_ca_en50221_check_camstatus() 260 sl->slot_state = DVB_CA_SLOTSTATE_VALIDATE; in dvb_ca_en50221_check_camstatus() 328 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_link_init() local 336 sl->da_irq_supported = 0; in dvb_ca_en50221_link_init() [all …]
|
/drivers/power/supply/ |
D | bq27xxx_battery_hdq.c | 28 static int w1_bq27000_read(struct w1_slave *sl, unsigned int reg) in w1_bq27000_read() argument 32 mutex_lock(&sl->master->bus_mutex); in w1_bq27000_read() 33 w1_write_8(sl->master, HDQ_CMD_READ | reg); in w1_bq27000_read() 34 val = w1_read_8(sl->master); in w1_bq27000_read() 35 mutex_unlock(&sl->master->bus_mutex); in w1_bq27000_read() 43 struct w1_slave *sl = dev_to_w1_slave(di->dev); in bq27xxx_battery_hdq_read() local 53 upper = w1_bq27000_read(sl, reg + 1); in bq27xxx_battery_hdq_read() 59 lower = w1_bq27000_read(sl, reg); in bq27xxx_battery_hdq_read() 63 upper = w1_bq27000_read(sl, reg + 1); in bq27xxx_battery_hdq_read() 72 return w1_bq27000_read(sl, reg); in bq27xxx_battery_hdq_read() [all …]
|
D | ds2760_battery.c | 122 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); in w1_ds2760_io() local 127 mutex_lock(&sl->master->bus_mutex); in w1_ds2760_io() 136 if (!w1_reset_select_slave(sl)) { in w1_ds2760_io() 138 w1_write_8(sl->master, W1_DS2760_READ_DATA); in w1_ds2760_io() 139 w1_write_8(sl->master, addr); in w1_ds2760_io() 140 count = w1_read_block(sl->master, buf, count); in w1_ds2760_io() 142 w1_write_8(sl->master, W1_DS2760_WRITE_DATA); in w1_ds2760_io() 143 w1_write_8(sl->master, addr); in w1_ds2760_io() 144 w1_write_block(sl->master, buf, count); in w1_ds2760_io() 150 mutex_unlock(&sl->master->bus_mutex); in w1_ds2760_io() [all …]
|