Lines Matching full:peripheral

26 static int cs35l56_sdw_read_one(struct sdw_slave *peripheral, unsigned int reg, void *buf)  in cs35l56_sdw_read_one()  argument
30 ret = sdw_nread_no_pm(peripheral, reg, 4, (u8 *)buf); in cs35l56_sdw_read_one()
32 dev_err(&peripheral->dev, "Read failed @%#x:%d\n", reg, ret); in cs35l56_sdw_read_one()
45 struct sdw_slave *peripheral = context; in cs35l56_sdw_read() local
54 return cs35l56_sdw_read_one(peripheral, reg, val_buf); in cs35l56_sdw_read()
61 ret = sdw_nread_no_pm(peripheral, reg, bytes, buf8); in cs35l56_sdw_read()
63 dev_err(&peripheral->dev, "Read failed @%#x..%#x:%d\n", in cs35l56_sdw_read()
86 static int cs35l56_sdw_write_one(struct sdw_slave *peripheral, unsigned int reg, const void *buf) in cs35l56_sdw_write_one() argument
91 ret = sdw_nwrite_no_pm(peripheral, reg, 4, (u8 *)&val_le); in cs35l56_sdw_write_one()
93 dev_err(&peripheral->dev, "Write failed @%#x:%d\n", reg, ret); in cs35l56_sdw_write_one()
104 struct sdw_slave *peripheral = context; in cs35l56_sdw_gather_write() local
114 return cs35l56_sdw_write_one(peripheral, reg, src_be); in cs35l56_sdw_gather_write()
125 ret = sdw_nwrite_no_pm(peripheral, reg, bytes, (u8 *)val_le_buf); in cs35l56_sdw_gather_write()
127 dev_err(&peripheral->dev, "Write failed @%#x..%#x:%d\n", in cs35l56_sdw_gather_write()
164 static void cs35l56_sdw_init(struct sdw_slave *peripheral) in cs35l56_sdw_init() argument
166 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_init()
185 sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_MASK_1, in cs35l56_sdw_init()
194 static int cs35l56_sdw_interrupt(struct sdw_slave *peripheral, in cs35l56_sdw_interrupt() argument
197 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_interrupt()
219 sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_MASK_1, 0); in cs35l56_sdw_interrupt()
220 sdw_read_no_pm(peripheral, CS35L56_SDW_GEN_INT_STAT_1); in cs35l56_sdw_interrupt()
221 sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_STAT_1, 0xFF); in cs35l56_sdw_interrupt()
243 static int cs35l56_sdw_read_prop(struct sdw_slave *peripheral) in cs35l56_sdw_read_prop() argument
245 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_read_prop()
246 struct sdw_slave_prop *prop = &peripheral->prop; in cs35l56_sdw_read_prop()
275 static int cs35l56_sdw_update_status(struct sdw_slave *peripheral, in cs35l56_sdw_update_status() argument
278 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_update_status()
287 cs35l56_sdw_init(peripheral); in cs35l56_sdw_update_status()
303 struct sdw_slave *peripheral) in cs35l56_a1_kick_divider() argument
311 if (peripheral->bus->params.curr_bank) { in cs35l56_a1_kick_divider()
325 curr_scale = sdw_read_no_pm(peripheral, curr_scale_reg); in cs35l56_a1_kick_divider()
331 next_scale = sdw_read_no_pm(peripheral, next_scale_reg); in cs35l56_a1_kick_divider()
339 ret = sdw_write_no_pm(peripheral, next_scale_reg, next_scale); in cs35l56_a1_kick_divider()
348 ret = sdw_write_no_pm(peripheral, curr_scale_reg, CS35L56_SDW_INVALID_BUS_SCALE); in cs35l56_a1_kick_divider()
359 static int cs35l56_sdw_bus_config(struct sdw_slave *peripheral, in cs35l56_sdw_bus_config() argument
362 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_bus_config()
370 return cs35l56_a1_kick_divider(cs35l56, peripheral); in cs35l56_sdw_bus_config()
375 static int __maybe_unused cs35l56_sdw_clk_stop(struct sdw_slave *peripheral, in cs35l56_sdw_clk_stop() argument
379 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_clk_stop()
398 struct sdw_slave *peripheral = cs35l56->sdw_peripheral; in cs35l56_sdw_handle_unattach() local
400 if (peripheral->unattach_request) { in cs35l56_sdw_handle_unattach()
403 if (!wait_for_completion_timeout(&peripheral->initialization_complete, in cs35l56_sdw_handle_unattach()
409 peripheral->unattach_request = 0; in cs35l56_sdw_handle_unattach()
488 static int cs35l56_sdw_probe(struct sdw_slave *peripheral, const struct sdw_device_id *id) in cs35l56_sdw_probe() argument
490 struct device *dev = &peripheral->dev; in cs35l56_sdw_probe()
499 cs35l56->sdw_peripheral = peripheral; in cs35l56_sdw_probe()
505 peripheral, &cs35l56_regmap_sdw); in cs35l56_sdw_probe()
521 static int cs35l56_sdw_remove(struct sdw_slave *peripheral) in cs35l56_sdw_remove() argument
523 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_remove()
528 sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_MASK_1, 0); in cs35l56_sdw_remove()
529 sdw_read_no_pm(peripheral, CS35L56_SDW_GEN_INT_STAT_1); in cs35l56_sdw_remove()
530 sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_STAT_1, 0xFF); in cs35l56_sdw_remove()