Lines Matching refs:val
55 static int hi8435_readb(struct hi8435_priv *priv, u8 reg, u8 *val)
58 return spi_write_then_read(priv->spi, ®, 1, val, 1);
61 static int hi8435_readw(struct hi8435_priv *priv, u8 reg, u16 *val)
68 *val = be16_to_cpu(be_val);
73 static int hi8435_readl(struct hi8435_priv *priv, u8 reg, u32 *val)
80 *val = be32_to_cpu(be_val);
85 static int hi8435_writeb(struct hi8435_priv *priv, u8 reg, u8 val)
88 priv->reg_buffer[1] = val;
93 static int hi8435_writew(struct hi8435_priv *priv, u8 reg, u16 val)
96 priv->reg_buffer[1] = (val >> 8) & 0xff;
97 priv->reg_buffer[2] = val & 0xff;
104 int *val, int *val2, long mask)
115 *val = !!(tmp & BIT(chan->channel));
162 int *val, int *val2)
182 *val = ((reg & 0xff) - (reg >> 8)) / 2;
184 *val = ((reg & 0xff) + (reg >> 8)) / 2;
194 int val, int val2)
215 if (val < 2 || val > 21 || (val + 2) > priv->threshold_hi[mode])
218 if (val == priv->threshold_lo[mode])
221 priv->threshold_lo[mode] = val;
228 if (val < 3 || val > 22 || val < (priv->threshold_lo[mode] + 2))
231 if (val == priv->threshold_hi[mode])
234 priv->threshold_hi[mode] = val;
271 u8 val;
274 ret = hi8435_readb(priv, reg, &val);
275 *readval = val;
277 val = (u8)writeval;
278 ret = hi8435_writeb(priv, reg, val);
413 static void hi8435_iio_push_event(struct iio_dev *idev, unsigned int val)
418 unsigned int status = priv->event_prev_val ^ val;
425 dir = val & BIT(i) ? IIO_EV_DIR_RISING :
434 priv->event_prev_val = val;
442 u32 val;
445 ret = hi8435_readl(priv, HI8435_SO31_0_REG, &val);
449 hi8435_iio_push_event(idev, val);