Lines Matching refs:bh1780
43 static int bh1780_write(struct bh1780_data *bh1780, u8 reg, u8 val)
45 int ret = i2c_smbus_write_byte_data(bh1780->client,
49 dev_err(&bh1780->client->dev,
56 static int bh1780_read(struct bh1780_data *bh1780, u8 reg)
58 int ret = i2c_smbus_read_byte_data(bh1780->client,
61 dev_err(&bh1780->client->dev,
68 static int bh1780_read_word(struct bh1780_data *bh1780, u8 reg)
70 int ret = i2c_smbus_read_word_data(bh1780->client,
73 dev_err(&bh1780->client->dev,
84 struct bh1780_data *bh1780 = iio_priv(indio_dev);
88 return bh1780_write(bh1780, (u8)reg, (u8)writeval);
90 ret = bh1780_read(bh1780, (u8)reg);
103 struct bh1780_data *bh1780 = iio_priv(indio_dev);
110 pm_runtime_get_sync(&bh1780->client->dev);
111 value = bh1780_read_word(bh1780, BH1780_REG_DLOW);
114 pm_runtime_mark_last_busy(&bh1780->client->dev);
115 pm_runtime_put_autosuspend(&bh1780->client->dev);
148 struct bh1780_data *bh1780;
155 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*bh1780));
159 bh1780 = iio_priv(indio_dev);
160 bh1780->client = client;
164 ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_PON);
172 ret = bh1780_read(bh1780, BH1780_REG_PARTID);
189 indio_dev->name = "bh1780";
208 struct bh1780_data *bh1780 = iio_priv(indio_dev);
215 ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_POFF);
229 struct bh1780_data *bh1780 = iio_priv(indio_dev);
232 ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_POFF);
245 struct bh1780_data *bh1780 = iio_priv(indio_dev);
248 ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_PON);
269 { "bh1780", 0 },
286 .name = "bh1780",