Lines Matching refs:cb
33 static inline u8 lm3533_ctrlbank_get_reg(struct lm3533_ctrlbank *cb, u8 base) in lm3533_ctrlbank_get_reg() argument
35 return base + cb->id; in lm3533_ctrlbank_get_reg()
38 int lm3533_ctrlbank_enable(struct lm3533_ctrlbank *cb) in lm3533_ctrlbank_enable() argument
43 dev_dbg(cb->dev, "%s - %d\n", __func__, cb->id); in lm3533_ctrlbank_enable()
45 mask = 1 << cb->id; in lm3533_ctrlbank_enable()
46 ret = lm3533_update(cb->lm3533, LM3533_REG_CTRLBANK_ENABLE, in lm3533_ctrlbank_enable()
49 dev_err(cb->dev, "failed to enable ctrlbank %d\n", cb->id); in lm3533_ctrlbank_enable()
55 int lm3533_ctrlbank_disable(struct lm3533_ctrlbank *cb) in lm3533_ctrlbank_disable() argument
60 dev_dbg(cb->dev, "%s - %d\n", __func__, cb->id); in lm3533_ctrlbank_disable()
62 mask = 1 << cb->id; in lm3533_ctrlbank_disable()
63 ret = lm3533_update(cb->lm3533, LM3533_REG_CTRLBANK_ENABLE, 0, mask); in lm3533_ctrlbank_disable()
65 dev_err(cb->dev, "failed to disable ctrlbank %d\n", cb->id); in lm3533_ctrlbank_disable()
76 int lm3533_ctrlbank_set_max_current(struct lm3533_ctrlbank *cb, u16 imax) in lm3533_ctrlbank_set_max_current() argument
87 reg = lm3533_ctrlbank_get_reg(cb, LM3533_REG_MAX_CURRENT_BASE); in lm3533_ctrlbank_set_max_current()
88 ret = lm3533_write(cb->lm3533, reg, val); in lm3533_ctrlbank_set_max_current()
90 dev_err(cb->dev, "failed to set max current\n"); in lm3533_ctrlbank_set_max_current()
97 int lm3533_ctrlbank_set_##_name(struct lm3533_ctrlbank *cb, u8 val) \
105 reg = lm3533_ctrlbank_get_reg(cb, LM3533_REG_##_NAME##_BASE); \
106 ret = lm3533_write(cb->lm3533, reg, val); \
108 dev_err(cb->dev, "failed to set " #_name "\n"); \
115 int lm3533_ctrlbank_get_##_name(struct lm3533_ctrlbank *cb, u8 *val) \
120 reg = lm3533_ctrlbank_get_reg(cb, LM3533_REG_##_NAME##_BASE); \
121 ret = lm3533_read(cb->lm3533, reg, val); \
123 dev_err(cb->dev, "failed to get " #_name "\n"); \