Home
last modified time | relevance | path

Searched refs:st (Results 1 – 25 of 287) sorted by relevance

12345678910>>...12

/drivers/isdn/hisax/
Disdnl2.c148 freewin(struct PStack *st) in freewin() argument
150 freewin1(&st->l2); in freewin()
163 cansend(struct PStack *st) in cansend() argument
167 if (test_bit(FLG_MOD128, &st->l2.flag)) in cansend()
168 p1 = (st->l2.vs - st->l2.va) % 128; in cansend()
170 p1 = (st->l2.vs - st->l2.va) % 8; in cansend()
171 return ((p1 < st->l2.window) && !test_bit(FLG_PEER_BUSY, &st->l2.flag)); in cansend()
218 enqueue_super(struct PStack *st, in enqueue_super() argument
221 if (test_bit(FLG_LAPB, &st->l2.flag)) in enqueue_super()
222 st->l1.bcs->tx_cnt += skb->len; in enqueue_super()
[all …]
Dtei.c38 void tei_handler(struct PStack *st, u_char pr, struct sk_buff *skb);
88 findtei(struct PStack *st, int tei) in findtei() argument
90 struct PStack *ptr = *(st->l1.stlistp); in findtei()
104 put_tei_msg(struct PStack *st, u_char m_id, unsigned int ri, u_char tei) in put_tei_msg() argument
123 st->l2.l2l1(st, PH_DATA | REQUEST, skb); in put_tei_msg()
129 struct PStack *st = fi->userdata; in tei_id_request() local
131 if (st->l2.tei != -1) { in tei_id_request()
132 st->ma.tei_m.printdebug(&st->ma.tei_m, in tei_id_request()
134 st->l2.tei); in tei_id_request()
137 st->ma.ri = random_ri(); in tei_id_request()
[all …]
Disdnl3.c73 struct PStack *st = fi->userdata; in l3m_debug() local
76 VHiSax_putstatus(st->l1.hardware, st->l3.debug_id, fmt, args); in l3m_debug()
156 l3_debug(pc->st, "newstate cr %d %d --> %d", in newl3state()
165 t->pc->st->lli.l4l3(t->pc->st, t->event, t->pc); in L3ExpireTimer()
218 no_l3_proto(struct PStack *st, int pr, void *arg) in no_l3_proto() argument
222 HiSax_putstatus(st->l1.hardware, "L3", "no D protocol"); in no_l3_proto()
229 no_l3_proto_spec(struct PStack *st, isdn_ctrl *ic) in no_l3_proto_spec() argument
236 *getl3proc(struct PStack *st, int cr) in getl3proc() argument
238 struct l3_process *p = st->l3.proc; in getl3proc()
249 *new_l3_process(struct PStack *st, int cr) in new_l3_process() argument
[all …]
Disdnl1.c145 struct PStack *st = fi->userdata; in l1m_debug() local
146 struct IsdnCardState *cs = st->l1.hardware; in l1m_debug()
158 struct PStack *st; in L1activated() local
160 st = cs->stlist; in L1activated()
161 while (st) { in L1activated()
162 if (test_and_clear_bit(FLG_L1_ACTIVATING, &st->l1.Flags)) in L1activated()
163 st->l1.l1l2(st, PH_ACTIVATE | CONFIRM, NULL); in L1activated()
165 st->l1.l1l2(st, PH_ACTIVATE | INDICATION, NULL); in L1activated()
166 st = st->next; in L1activated()
173 struct PStack *st; in L1deactivated() local
[all …]
/drivers/staging/iio/meter/
Dade7854-i2c.c24 struct ade7854_state *st = iio_priv(indio_dev); in ade7854_i2c_write_reg_8() local
26 mutex_lock(&st->buf_lock); in ade7854_i2c_write_reg_8()
27 st->tx[0] = (reg_address >> 8) & 0xFF; in ade7854_i2c_write_reg_8()
28 st->tx[1] = reg_address & 0xFF; in ade7854_i2c_write_reg_8()
29 st->tx[2] = value; in ade7854_i2c_write_reg_8()
31 ret = i2c_master_send(st->i2c, st->tx, 3); in ade7854_i2c_write_reg_8()
32 mutex_unlock(&st->buf_lock); in ade7854_i2c_write_reg_8()
43 struct ade7854_state *st = iio_priv(indio_dev); in ade7854_i2c_write_reg_16() local
45 mutex_lock(&st->buf_lock); in ade7854_i2c_write_reg_16()
46 st->tx[0] = (reg_address >> 8) & 0xFF; in ade7854_i2c_write_reg_16()
[all …]
Dade7854-spi.c24 struct ade7854_state *st = iio_priv(indio_dev); in ade7854_spi_write_reg_8() local
26 .tx_buf = st->tx, in ade7854_spi_write_reg_8()
31 mutex_lock(&st->buf_lock); in ade7854_spi_write_reg_8()
32 st->tx[0] = ADE7854_WRITE_REG; in ade7854_spi_write_reg_8()
33 st->tx[1] = (reg_address >> 8) & 0xFF; in ade7854_spi_write_reg_8()
34 st->tx[2] = reg_address & 0xFF; in ade7854_spi_write_reg_8()
35 st->tx[3] = value & 0xFF; in ade7854_spi_write_reg_8()
37 ret = spi_sync_transfer(st->spi, &xfer, 1); in ade7854_spi_write_reg_8()
38 mutex_unlock(&st->buf_lock); in ade7854_spi_write_reg_8()
49 struct ade7854_state *st = iio_priv(indio_dev); in ade7854_spi_write_reg_16() local
[all …]
/drivers/macintosh/
Dwindfarm_pid.c26 void wf_pid_init(struct wf_pid_state *st, struct wf_pid_param *param) in wf_pid_init() argument
28 memset(st, 0, sizeof(struct wf_pid_state)); in wf_pid_init()
29 st->param = *param; in wf_pid_init()
30 st->first = 1; in wf_pid_init()
34 s32 wf_pid_run(struct wf_pid_state *st, s32 new_sample) in wf_pid_run() argument
38 int i, hlen = st->param.history_len; in wf_pid_run()
41 error = new_sample - st->param.itarget; in wf_pid_run()
44 if (st->first) { in wf_pid_run()
46 st->samples[i] = new_sample; in wf_pid_run()
47 st->errors[i] = error; in wf_pid_run()
[all …]
/drivers/iio/adc/
Dat91_adc.c137 #define AT91_ADC_CHAN(st, ch) \ argument
138 (st->registers->channel_base + (ch * 4))
139 #define at91_adc_readl(st, reg) \ argument
140 (readl_relaxed(st->reg_base + reg))
141 #define at91_adc_writel(st, reg, val) \ argument
142 (writel_relaxed(val, st->reg_base + reg))
247 struct at91_adc_state *st = iio_priv(idev); in at91_adc_trigger_handler() local
253 st->buffer[j] = at91_adc_readl(st, AT91_ADC_CHAN(st, i)); in at91_adc_trigger_handler()
257 iio_push_to_buffers_with_timestamp(idev, st->buffer, pf->timestamp); in at91_adc_trigger_handler()
262 at91_adc_readl(st, AT91_ADC_LCDR); in at91_adc_trigger_handler()
[all …]
Dad7298.c108 struct ad7298_state *st = iio_priv(indio_dev); in ad7298_update_scan_mode() local
116 command = AD7298_WRITE | st->ext_ref; in ad7298_update_scan_mode()
122 st->tx_buf[0] = cpu_to_be16(command); in ad7298_update_scan_mode()
125 st->ring_xfer[0].tx_buf = &st->tx_buf[0]; in ad7298_update_scan_mode()
126 st->ring_xfer[0].len = 2; in ad7298_update_scan_mode()
127 st->ring_xfer[0].cs_change = 1; in ad7298_update_scan_mode()
128 st->ring_xfer[1].tx_buf = &st->tx_buf[1]; in ad7298_update_scan_mode()
129 st->ring_xfer[1].len = 2; in ad7298_update_scan_mode()
130 st->ring_xfer[1].cs_change = 1; in ad7298_update_scan_mode()
132 spi_message_init(&st->ring_msg); in ad7298_update_scan_mode()
[all …]
Dad7887.c79 struct ad7887_state *st = iio_priv(indio_dev); in ad7887_ring_preenable() local
84 st->ring_msg = &st->msg[AD7887_CH0]; in ad7887_ring_preenable()
87 st->ring_msg = &st->msg[AD7887_CH1]; in ad7887_ring_preenable()
89 spi_sync(st->spi, st->ring_msg); in ad7887_ring_preenable()
92 st->ring_msg = &st->msg[AD7887_CH0_CH1]; in ad7887_ring_preenable()
101 struct ad7887_state *st = iio_priv(indio_dev); in ad7887_ring_postdisable() local
104 return spi_sync(st->spi, &st->msg[AD7887_CH0]); in ad7887_ring_postdisable()
117 struct ad7887_state *st = iio_priv(indio_dev); in ad7887_trigger_handler() local
120 b_sent = spi_sync(st->spi, st->ring_msg); in ad7887_trigger_handler()
124 iio_push_to_buffers_with_timestamp(indio_dev, st->data, in ad7887_trigger_handler()
[all …]
Dnau7802.c93 static int nau7802_set_gain(struct nau7802_state *st, int gain) in nau7802_set_gain() argument
97 mutex_lock(&st->lock); in nau7802_set_gain()
98 st->conversion_count = 0; in nau7802_set_gain()
100 ret = i2c_smbus_read_byte_data(st->client, NAU7802_REG_CTRL1); in nau7802_set_gain()
103 ret = i2c_smbus_write_byte_data(st->client, NAU7802_REG_CTRL1, in nau7802_set_gain()
108 mutex_unlock(&st->lock); in nau7802_set_gain()
113 static int nau7802_read_conversion(struct nau7802_state *st) in nau7802_read_conversion() argument
117 mutex_lock(&st->data_lock); in nau7802_read_conversion()
118 data = i2c_smbus_read_byte_data(st->client, NAU7802_REG_ADC_B2); in nau7802_read_conversion()
121 st->last_value = data << 16; in nau7802_read_conversion()
[all …]
Dad7266.c52 static int ad7266_wakeup(struct ad7266_state *st) in ad7266_wakeup() argument
55 return spi_read(st->spi, &st->data.sample[0], 2); in ad7266_wakeup()
58 static int ad7266_powerdown(struct ad7266_state *st) in ad7266_powerdown() argument
61 return spi_read(st->spi, &st->data.sample[0], 1); in ad7266_powerdown()
66 struct ad7266_state *st = iio_priv(indio_dev); in ad7266_preenable() local
67 return ad7266_wakeup(st); in ad7266_preenable()
72 struct ad7266_state *st = iio_priv(indio_dev); in ad7266_postdisable() local
73 return ad7266_powerdown(st); in ad7266_postdisable()
87 struct ad7266_state *st = iio_priv(indio_dev); in ad7266_trigger_handler() local
90 ret = spi_read(st->spi, st->data.sample, 4); in ad7266_trigger_handler()
[all …]
/drivers/staging/iio/frequency/
Dad9832.c33 static int ad9832_write_frequency(struct ad9832_state *st, in ad9832_write_frequency() argument
38 if (fout > (st->mclk / 2)) in ad9832_write_frequency()
41 regval = ad9832_calc_freqreg(st->mclk, fout); in ad9832_write_frequency()
43 st->freq_data[0] = cpu_to_be16((AD9832_CMD_FRE8BITSW << CMD_SHIFT) | in ad9832_write_frequency()
46 st->freq_data[1] = cpu_to_be16((AD9832_CMD_FRE16BITSW << CMD_SHIFT) | in ad9832_write_frequency()
49 st->freq_data[2] = cpu_to_be16((AD9832_CMD_FRE8BITSW << CMD_SHIFT) | in ad9832_write_frequency()
52 st->freq_data[3] = cpu_to_be16((AD9832_CMD_FRE16BITSW << CMD_SHIFT) | in ad9832_write_frequency()
56 return spi_sync(st->spi, &st->freq_msg); in ad9832_write_frequency()
59 static int ad9832_write_phase(struct ad9832_state *st, in ad9832_write_phase() argument
65 st->phase_data[0] = cpu_to_be16((AD9832_CMD_PHA8BITSW << CMD_SHIFT) | in ad9832_write_phase()
[all …]
Dad9834.c36 static int ad9834_write_frequency(struct ad9834_state *st, in ad9834_write_frequency() argument
41 if (fout > (st->mclk / 2)) in ad9834_write_frequency()
44 regval = ad9834_calc_freqreg(st->mclk, fout); in ad9834_write_frequency()
46 st->freq_data[0] = cpu_to_be16(addr | (regval & in ad9834_write_frequency()
48 st->freq_data[1] = cpu_to_be16(addr | ((regval >> in ad9834_write_frequency()
52 return spi_sync(st->spi, &st->freq_msg); in ad9834_write_frequency()
55 static int ad9834_write_phase(struct ad9834_state *st, in ad9834_write_phase() argument
60 st->data = cpu_to_be16(addr | phase); in ad9834_write_phase()
62 return spi_sync(st->spi, &st->msg); in ad9834_write_phase()
71 struct ad9834_state *st = iio_priv(indio_dev); in ad9834_write() local
[all …]
/drivers/staging/iio/resolver/
Dad2s1210.c102 struct ad2s1210_state *st) in ad2s1210_set_mode() argument
104 gpio_set_value(st->pdata->a[0], ad2s1210_mode_vals[mode][0]); in ad2s1210_set_mode()
105 gpio_set_value(st->pdata->a[1], ad2s1210_mode_vals[mode][1]); in ad2s1210_set_mode()
106 st->mode = mode; in ad2s1210_set_mode()
110 static int ad2s1210_config_write(struct ad2s1210_state *st, u8 data) in ad2s1210_config_write() argument
114 ad2s1210_set_mode(MOD_CONFIG, st); in ad2s1210_config_write()
115 st->tx[0] = data; in ad2s1210_config_write()
116 ret = spi_write(st->sdev, st->tx, 1); in ad2s1210_config_write()
119 st->old_data = true; in ad2s1210_config_write()
125 static int ad2s1210_config_read(struct ad2s1210_state *st, in ad2s1210_config_read() argument
[all …]
/drivers/staging/iio/adc/
Dad7606_core.c27 int ad7606_reset(struct ad7606_state *st) in ad7606_reset() argument
29 if (gpio_is_valid(st->pdata->gpio_reset)) { in ad7606_reset()
30 gpio_set_value(st->pdata->gpio_reset, 1); in ad7606_reset()
32 gpio_set_value(st->pdata->gpio_reset, 0); in ad7606_reset()
41 struct ad7606_state *st = iio_priv(indio_dev); in ad7606_scan_direct() local
44 st->done = false; in ad7606_scan_direct()
45 gpio_set_value(st->pdata->gpio_convst, 1); in ad7606_scan_direct()
47 ret = wait_event_interruptible(st->wq_data_avail, st->done); in ad7606_scan_direct()
51 if (gpio_is_valid(st->pdata->gpio_frstdata)) { in ad7606_scan_direct()
52 ret = st->bops->read_block(st->dev, 1, st->data); in ad7606_scan_direct()
[all …]
Dad7280a.c168 static int ad7280_check_crc(struct ad7280_state *st, unsigned val) in ad7280_check_crc() argument
170 unsigned char crc = ad7280_calc_crc8(st->crc_tab, val >> 10); in ad7280_check_crc()
186 static void ad7280_delay(struct ad7280_state *st) in ad7280_delay() argument
188 if (st->readback_delay_us < 50) in ad7280_delay()
189 udelay(st->readback_delay_us); in ad7280_delay()
194 static int __ad7280_read32(struct ad7280_state *st, unsigned *val) in __ad7280_read32() argument
198 .tx_buf = &st->buf[0], in __ad7280_read32()
199 .rx_buf = &st->buf[1], in __ad7280_read32()
203 st->buf[0] = cpu_to_be32(AD7280A_READ_TXVAL); in __ad7280_read32()
205 ret = spi_sync_transfer(st->spi, &t, 1); in __ad7280_read32()
[all …]
Dad7192.c159 struct ad7192_state *st = ad_sigma_delta_to_ad7192(sd); in ad7192_set_channel() local
161 st->conf &= ~AD7192_CONF_CHAN_MASK; in ad7192_set_channel()
162 st->conf |= AD7192_CONF_CHAN(channel); in ad7192_set_channel()
164 return ad_sd_write_reg(&st->sd, AD7192_REG_CONF, 3, st->conf); in ad7192_set_channel()
170 struct ad7192_state *st = ad_sigma_delta_to_ad7192(sd); in ad7192_set_mode() local
172 st->mode &= ~AD7192_MODE_SEL_MASK; in ad7192_set_mode()
173 st->mode |= AD7192_MODE_SEL(mode); in ad7192_set_mode()
175 return ad_sd_write_reg(&st->sd, AD7192_REG_MODE, 3, st->mode); in ad7192_set_mode()
197 static int ad7192_calibrate_all(struct ad7192_state *st) in ad7192_calibrate_all() argument
199 return ad_sd_calibrate_all(&st->sd, ad7192_calib_arr, in ad7192_calibrate_all()
[all …]
/drivers/staging/iio/accel/
Dsca3000_core.c83 int sca3000_write_reg(struct sca3000_state *st, u8 address, u8 val) in sca3000_write_reg() argument
85 st->tx[0] = SCA3000_WRITE_REG(address); in sca3000_write_reg()
86 st->tx[1] = val; in sca3000_write_reg()
87 return spi_write(st->us, st->tx, 2); in sca3000_write_reg()
90 int sca3000_read_data_short(struct sca3000_state *st, in sca3000_read_data_short() argument
97 .tx_buf = st->tx, in sca3000_read_data_short()
100 .rx_buf = st->rx, in sca3000_read_data_short()
103 st->tx[0] = SCA3000_READ_REG(reg_address_high); in sca3000_read_data_short()
105 return spi_sync_transfer(st->us, xfer, ARRAY_SIZE(xfer)); in sca3000_read_data_short()
113 static int sca3000_reg_lock_on(struct sca3000_state *st) in sca3000_reg_lock_on() argument
[all …]
/drivers/iio/frequency/
Dadf4350.c68 static int adf4350_sync_config(struct adf4350_state *st) in adf4350_sync_config() argument
73 if ((st->regs_hw[i] != st->regs[i]) || in adf4350_sync_config()
83 st->val = cpu_to_be32(st->regs[i] | i); in adf4350_sync_config()
84 ret = spi_write(st->spi, &st->val, 4); in adf4350_sync_config()
87 st->regs_hw[i] = st->regs[i]; in adf4350_sync_config()
88 dev_dbg(&st->spi->dev, "[%d] 0x%X\n", in adf4350_sync_config()
89 i, (u32)st->regs[i] | i); in adf4350_sync_config()
99 struct adf4350_state *st = iio_priv(indio_dev); in adf4350_reg_access() local
107 st->regs[reg] = writeval & ~(BIT(0) | BIT(1) | BIT(2)); in adf4350_reg_access()
108 ret = adf4350_sync_config(st); in adf4350_reg_access()
[all …]
/drivers/isdn/mISDN/
Dstack.c27 _queue_message(struct mISDNstack *st, struct sk_buff *skb) in _queue_message() argument
34 skb_queue_tail(&st->msgq, skb); in _queue_message()
35 if (likely(!test_bit(mISDN_STACK_STOPPED, &st->status))) { in _queue_message()
36 test_and_set_bit(mISDN_STACK_WORK, &st->status); in _queue_message()
37 wake_up_interruptible(&st->workq); in _queue_message()
44 _queue_message(ch->st, skb); in mISDN_queue_message()
49 get_channel4id(struct mISDNstack *st, u_int id) in get_channel4id() argument
53 mutex_lock(&st->lmutex); in get_channel4id()
54 list_for_each_entry(ch, &st->layer2, list) { in get_channel4id()
60 mutex_unlock(&st->lmutex); in get_channel4id()
[all …]
/drivers/iio/imu/inv_mpu6050/
Dinv_mpu_core.c75 int inv_mpu6050_write_reg(struct inv_mpu6050_state *st, int reg, u8 d) in inv_mpu6050_write_reg() argument
77 return i2c_smbus_write_i2c_block_data(st->client, reg, 1, &d); in inv_mpu6050_write_reg()
80 int inv_mpu6050_switch_engine(struct inv_mpu6050_state *st, bool en, u32 mask) in inv_mpu6050_switch_engine() argument
89 result = i2c_smbus_read_i2c_block_data(st->client, in inv_mpu6050_switch_engine()
90 st->reg->pwr_mgmt_1, 1, &mgmt_1); in inv_mpu6050_switch_engine()
101 result = inv_mpu6050_write_reg(st, st->reg->pwr_mgmt_1, mgmt_1); in inv_mpu6050_switch_engine()
106 result = i2c_smbus_read_i2c_block_data(st->client, in inv_mpu6050_switch_engine()
107 st->reg->pwr_mgmt_2, 1, &d); in inv_mpu6050_switch_engine()
114 result = inv_mpu6050_write_reg(st, st->reg->pwr_mgmt_2, d); in inv_mpu6050_switch_engine()
124 result = inv_mpu6050_write_reg(st, in inv_mpu6050_switch_engine()
[all …]
/drivers/staging/iio/trigger/
Diio-trig-bfin-timer.c68 struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig); in iio_bfin_tmr_set_state() local
70 if (get_gptimer_period(st->t->id) == 0) in iio_bfin_tmr_set_state()
74 enable_gptimers(st->t->bit); in iio_bfin_tmr_set_state()
76 disable_gptimers(st->t->bit); in iio_bfin_tmr_set_state()
85 struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig); in iio_bfin_tmr_frequency_store() local
97 enabled = get_enabled_gptimers() & st->t->bit; in iio_bfin_tmr_frequency_store()
100 disable_gptimers(st->t->bit); in iio_bfin_tmr_frequency_store()
106 if (val <= 4 || val <= st->duty) in iio_bfin_tmr_frequency_store()
109 set_gptimer_period(st->t->id, val); in iio_bfin_tmr_frequency_store()
110 set_gptimer_pwidth(st->t->id, val - st->duty); in iio_bfin_tmr_frequency_store()
[all …]
/drivers/staging/iio/impedance-analyzer/
Dad5933.c182 static int ad5933_cmd(struct ad5933_state *st, unsigned char cmd) in ad5933_cmd() argument
184 unsigned char dat = st->ctrl_hb | cmd; in ad5933_cmd()
186 return ad5933_i2c_write(st->client, in ad5933_cmd()
190 static int ad5933_reset(struct ad5933_state *st) in ad5933_reset() argument
192 unsigned char dat = st->ctrl_lb | AD5933_CTRL_RESET; in ad5933_reset()
194 return ad5933_i2c_write(st->client, in ad5933_reset()
198 static int ad5933_wait_busy(struct ad5933_state *st, unsigned char event) in ad5933_wait_busy() argument
204 ret = ad5933_i2c_read(st->client, AD5933_REG_STATUS, 1, &val); in ad5933_wait_busy()
216 static int ad5933_set_freq(struct ad5933_state *st, in ad5933_set_freq() argument
226 do_div(freqreg, st->mclk_hz / 4); in ad5933_set_freq()
[all …]
/drivers/iio/dac/
Dad5791.c111 static int ad5791_spi_write(struct ad5791_state *st, u8 addr, u32 val) in ad5791_spi_write() argument
113 st->data[0].d32 = cpu_to_be32(AD5791_CMD_WRITE | in ad5791_spi_write()
117 return spi_write(st->spi, &st->data[0].d8[1], 3); in ad5791_spi_write()
120 static int ad5791_spi_read(struct ad5791_state *st, u8 addr, u32 *val) in ad5791_spi_read() argument
125 .tx_buf = &st->data[0].d8[1], in ad5791_spi_read()
130 .tx_buf = &st->data[1].d8[1], in ad5791_spi_read()
131 .rx_buf = &st->data[2].d8[1], in ad5791_spi_read()
137 st->data[0].d32 = cpu_to_be32(AD5791_CMD_READ | in ad5791_spi_read()
139 st->data[1].d32 = cpu_to_be32(AD5791_ADDR(AD5791_ADDR_NOOP)); in ad5791_spi_read()
141 ret = spi_sync_transfer(st->spi, xfers, ARRAY_SIZE(xfers)); in ad5791_spi_read()
[all …]

12345678910>>...12