Lines Matching full:cb
28 static inline u8 lm3533_ctrlbank_get_reg(struct lm3533_ctrlbank *cb, u8 base) in lm3533_ctrlbank_get_reg() argument
30 return base + cb->id; in lm3533_ctrlbank_get_reg()
33 int lm3533_ctrlbank_enable(struct lm3533_ctrlbank *cb) in lm3533_ctrlbank_enable() argument
38 dev_dbg(cb->dev, "%s - %d\n", __func__, cb->id); in lm3533_ctrlbank_enable()
40 mask = 1 << cb->id; in lm3533_ctrlbank_enable()
41 ret = lm3533_update(cb->lm3533, LM3533_REG_CTRLBANK_ENABLE, in lm3533_ctrlbank_enable()
44 dev_err(cb->dev, "failed to enable ctrlbank %d\n", cb->id); in lm3533_ctrlbank_enable()
50 int lm3533_ctrlbank_disable(struct lm3533_ctrlbank *cb) in lm3533_ctrlbank_disable() argument
55 dev_dbg(cb->dev, "%s - %d\n", __func__, cb->id); in lm3533_ctrlbank_disable()
57 mask = 1 << cb->id; in lm3533_ctrlbank_disable()
58 ret = lm3533_update(cb->lm3533, LM3533_REG_CTRLBANK_ENABLE, 0, mask); in lm3533_ctrlbank_disable()
60 dev_err(cb->dev, "failed to disable ctrlbank %d\n", cb->id); in lm3533_ctrlbank_disable()
71 int lm3533_ctrlbank_set_max_current(struct lm3533_ctrlbank *cb, u16 imax) in lm3533_ctrlbank_set_max_current() argument
82 reg = lm3533_ctrlbank_get_reg(cb, LM3533_REG_MAX_CURRENT_BASE); in lm3533_ctrlbank_set_max_current()
83 ret = lm3533_write(cb->lm3533, reg, val); in lm3533_ctrlbank_set_max_current()
85 dev_err(cb->dev, "failed to set max current\n"); in lm3533_ctrlbank_set_max_current()
91 int lm3533_ctrlbank_set_brightness(struct lm3533_ctrlbank *cb, u8 val) in lm3533_ctrlbank_set_brightness() argument
96 reg = lm3533_ctrlbank_get_reg(cb, LM3533_REG_BRIGHTNESS_BASE); in lm3533_ctrlbank_set_brightness()
97 ret = lm3533_write(cb->lm3533, reg, val); in lm3533_ctrlbank_set_brightness()
99 dev_err(cb->dev, "failed to set brightness\n"); in lm3533_ctrlbank_set_brightness()
105 int lm3533_ctrlbank_get_brightness(struct lm3533_ctrlbank *cb, u8 *val) in lm3533_ctrlbank_get_brightness() argument
110 reg = lm3533_ctrlbank_get_reg(cb, LM3533_REG_BRIGHTNESS_BASE); in lm3533_ctrlbank_get_brightness()
111 ret = lm3533_read(cb->lm3533, reg, val); in lm3533_ctrlbank_get_brightness()
113 dev_err(cb->dev, "failed to get brightness\n"); in lm3533_ctrlbank_get_brightness()
129 int lm3533_ctrlbank_set_pwm(struct lm3533_ctrlbank *cb, u8 val) in lm3533_ctrlbank_set_pwm() argument
137 reg = lm3533_ctrlbank_get_reg(cb, LM3533_REG_PWM_BASE); in lm3533_ctrlbank_set_pwm()
138 ret = lm3533_write(cb->lm3533, reg, val); in lm3533_ctrlbank_set_pwm()
140 dev_err(cb->dev, "failed to set PWM mask\n"); in lm3533_ctrlbank_set_pwm()
146 int lm3533_ctrlbank_get_pwm(struct lm3533_ctrlbank *cb, u8 *val) in lm3533_ctrlbank_get_pwm() argument
151 reg = lm3533_ctrlbank_get_reg(cb, LM3533_REG_PWM_BASE); in lm3533_ctrlbank_get_pwm()
152 ret = lm3533_read(cb->lm3533, reg, val); in lm3533_ctrlbank_get_pwm()
154 dev_err(cb->dev, "failed to get PWM mask\n"); in lm3533_ctrlbank_get_pwm()