Lines Matching refs:peripheral

37 static int cs35l56_sdw_poll_mem_status(struct sdw_slave *peripheral,  in cs35l56_sdw_poll_mem_status()  argument
46 false, peripheral, CS35L56_SDW_MEM_ACCESS_STATUS); in cs35l56_sdw_poll_mem_status()
56 static int cs35l56_sdw_slow_read(struct sdw_slave *peripheral, unsigned int reg, in cs35l56_sdw_slow_read() argument
65 ret = cs35l56_sdw_poll_mem_status(peripheral, in cs35l56_sdw_slow_read()
69 dev_err(&peripheral->dev, "!CMD_IN_PROGRESS fail: %d\n", ret); in cs35l56_sdw_slow_read()
74 sdw_read_no_pm(peripheral, reg + i); in cs35l56_sdw_slow_read()
77 ret = cs35l56_sdw_poll_mem_status(peripheral, in cs35l56_sdw_slow_read()
81 dev_err(&peripheral->dev, "RDATA_RDY fail: %d\n", ret); in cs35l56_sdw_slow_read()
86 ret = sdw_nread_no_pm(peripheral, CS35L56_SDW_MEM_READ_DATA, in cs35l56_sdw_slow_read()
89 dev_err(&peripheral->dev, "Late read @%#x failed: %d\n", reg + i, ret); in cs35l56_sdw_slow_read()
99 static int cs35l56_sdw_read_one(struct sdw_slave *peripheral, unsigned int reg, void *buf) in cs35l56_sdw_read_one() argument
103 ret = sdw_nread_no_pm(peripheral, reg, 4, (u8 *)buf); in cs35l56_sdw_read_one()
105 dev_err(&peripheral->dev, "Read failed @%#x:%d\n", reg, ret); in cs35l56_sdw_read_one()
118 struct sdw_slave *peripheral = context; in cs35l56_sdw_read() local
126 return cs35l56_sdw_slow_read(peripheral, reg, buf8, val_size); in cs35l56_sdw_read()
131 return cs35l56_sdw_read_one(peripheral, reg, val_buf); in cs35l56_sdw_read()
138 ret = sdw_nread_no_pm(peripheral, reg, bytes, buf8); in cs35l56_sdw_read()
140 dev_err(&peripheral->dev, "Read failed @%#x..%#x:%d\n", in cs35l56_sdw_read()
163 static int cs35l56_sdw_write_one(struct sdw_slave *peripheral, unsigned int reg, const void *buf) in cs35l56_sdw_write_one() argument
168 ret = sdw_nwrite_no_pm(peripheral, reg, 4, (u8 *)&val_le); in cs35l56_sdw_write_one()
170 dev_err(&peripheral->dev, "Write failed @%#x:%d\n", reg, ret); in cs35l56_sdw_write_one()
181 struct sdw_slave *peripheral = context; in cs35l56_sdw_gather_write() local
191 return cs35l56_sdw_write_one(peripheral, reg, src_be); in cs35l56_sdw_gather_write()
202 ret = sdw_nwrite_no_pm(peripheral, reg, bytes, (u8 *)val_le_buf); in cs35l56_sdw_gather_write()
204 dev_err(&peripheral->dev, "Write failed @%#x..%#x:%d\n", in cs35l56_sdw_gather_write()
255 static void cs35l56_sdw_init(struct sdw_slave *peripheral) in cs35l56_sdw_init() argument
257 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_init()
280 sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_MASK_1, in cs35l56_sdw_init()
289 static int cs35l56_sdw_interrupt(struct sdw_slave *peripheral, in cs35l56_sdw_interrupt() argument
292 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_interrupt()
314 sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_MASK_1, 0); in cs35l56_sdw_interrupt()
315 sdw_read_no_pm(peripheral, CS35L56_SDW_GEN_INT_STAT_1); in cs35l56_sdw_interrupt()
316 sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_STAT_1, 0xFF); in cs35l56_sdw_interrupt()
338 static int cs35l56_sdw_read_prop(struct sdw_slave *peripheral) in cs35l56_sdw_read_prop() argument
340 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_read_prop()
341 struct sdw_slave_prop *prop = &peripheral->prop; in cs35l56_sdw_read_prop()
369 static int cs35l56_sdw_update_status(struct sdw_slave *peripheral, in cs35l56_sdw_update_status() argument
372 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_update_status()
381 cs35l56_sdw_init(peripheral); in cs35l56_sdw_update_status()
396 static int __maybe_unused cs35l56_sdw_clk_stop(struct sdw_slave *peripheral, in cs35l56_sdw_clk_stop() argument
400 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_clk_stop()
418 struct sdw_slave *peripheral = cs35l56->sdw_peripheral; in cs35l56_sdw_handle_unattach() local
420 if (peripheral->unattach_request) { in cs35l56_sdw_handle_unattach()
423 if (!wait_for_completion_timeout(&peripheral->initialization_complete, in cs35l56_sdw_handle_unattach()
429 peripheral->unattach_request = 0; in cs35l56_sdw_handle_unattach()
508 static int cs35l56_sdw_probe(struct sdw_slave *peripheral, const struct sdw_device_id *id) in cs35l56_sdw_probe() argument
510 struct device *dev = &peripheral->dev; in cs35l56_sdw_probe()
519 cs35l56->sdw_peripheral = peripheral; in cs35l56_sdw_probe()
525 peripheral, &cs35l56_regmap_sdw); in cs35l56_sdw_probe()
541 static int cs35l56_sdw_remove(struct sdw_slave *peripheral) in cs35l56_sdw_remove() argument
543 struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev); in cs35l56_sdw_remove()
548 sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_MASK_1, 0); in cs35l56_sdw_remove()
549 sdw_read_no_pm(peripheral, CS35L56_SDW_GEN_INT_STAT_1); in cs35l56_sdw_remove()
550 sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_STAT_1, 0xFF); in cs35l56_sdw_remove()