Lines Matching refs:bh1780

43 static int bh1780_write(struct bh1780_data *bh1780, u8 reg, u8 val)  in bh1780_write()  argument
45 int ret = i2c_smbus_write_byte_data(bh1780->client, in bh1780_write()
49 dev_err(&bh1780->client->dev, in bh1780_write()
56 static int bh1780_read(struct bh1780_data *bh1780, u8 reg) in bh1780_read() argument
58 int ret = i2c_smbus_read_byte_data(bh1780->client, in bh1780_read()
61 dev_err(&bh1780->client->dev, in bh1780_read()
68 static int bh1780_read_word(struct bh1780_data *bh1780, u8 reg) in bh1780_read_word() argument
70 int ret = i2c_smbus_read_word_data(bh1780->client, in bh1780_read_word()
73 dev_err(&bh1780->client->dev, in bh1780_read_word()
84 struct bh1780_data *bh1780 = iio_priv(indio_dev); in bh1780_debugfs_reg_access() local
88 return bh1780_write(bh1780, (u8)reg, (u8)writeval); in bh1780_debugfs_reg_access()
90 ret = bh1780_read(bh1780, (u8)reg); in bh1780_debugfs_reg_access()
103 struct bh1780_data *bh1780 = iio_priv(indio_dev); in bh1780_read_raw() local
110 pm_runtime_get_sync(&bh1780->client->dev); in bh1780_read_raw()
111 value = bh1780_read_word(bh1780, BH1780_REG_DLOW); in bh1780_read_raw()
114 pm_runtime_mark_last_busy(&bh1780->client->dev); in bh1780_read_raw()
115 pm_runtime_put_autosuspend(&bh1780->client->dev); in bh1780_read_raw()
147 struct bh1780_data *bh1780; in bh1780_probe() local
154 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*bh1780)); in bh1780_probe()
158 bh1780 = iio_priv(indio_dev); in bh1780_probe()
159 bh1780->client = client; in bh1780_probe()
163 ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_PON); in bh1780_probe()
171 ret = bh1780_read(bh1780, BH1780_REG_PARTID); in bh1780_probe()
207 struct bh1780_data *bh1780 = iio_priv(indio_dev); in bh1780_remove() local
214 ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_POFF); in bh1780_remove()
224 struct bh1780_data *bh1780 = iio_priv(indio_dev); in bh1780_runtime_suspend() local
227 ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_POFF); in bh1780_runtime_suspend()
240 struct bh1780_data *bh1780 = iio_priv(indio_dev); in bh1780_runtime_resume() local
243 ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_PON); in bh1780_runtime_resume()