Lines Matching refs:peripheral
203 static int cs42l42_sdw_poll_status(struct sdw_slave *peripheral, u8 mask, u8 match) in cs42l42_sdw_poll_status() argument
210 false, peripheral, CS42L42_SDW_MEM_ACCESS_STATUS); in cs42l42_sdw_poll_status()
215 dev_err(&peripheral->dev, "MEM_ACCESS_STATUS & %#x for %#x fail: %d\n", in cs42l42_sdw_poll_status()
223 struct sdw_slave *peripheral = context; in cs42l42_sdw_read() local
229 ret = cs42l42_sdw_poll_status(peripheral, CS42L42_SDW_CMD_IN_PROGRESS, 0); in cs42l42_sdw_read()
233 ret = sdw_read_no_pm(peripheral, reg); in cs42l42_sdw_read()
235 dev_err(&peripheral->dev, "Failed to issue read @0x%x: %d\n", reg, ret); in cs42l42_sdw_read()
240 ret = sdw_read_no_pm(peripheral, CS42L42_SDW_MEM_ACCESS_STATUS); in cs42l42_sdw_read()
242 dev_err(&peripheral->dev, "Failed to read MEM_ACCESS_STATUS: %d\n", ret); in cs42l42_sdw_read()
254 ret = cs42l42_sdw_poll_status(peripheral, in cs42l42_sdw_read()
260 ret = sdw_read_no_pm(peripheral, CS42L42_SDW_MEM_READ_DATA); in cs42l42_sdw_read()
262 dev_err(&peripheral->dev, "Failed to read READ_DATA: %d\n", ret); in cs42l42_sdw_read()
273 struct sdw_slave *peripheral = context; in cs42l42_sdw_write() local
276 ret = cs42l42_sdw_poll_status(peripheral, CS42L42_SDW_CMD_IN_PROGRESS, 0); in cs42l42_sdw_write()
280 return sdw_write_no_pm(peripheral, reg + CS42L42_SDW_ADDR_OFFSET, (u8)val); in cs42l42_sdw_write()
284 static void cs42l42_sdw_init(struct sdw_slave *peripheral) in cs42l42_sdw_init() argument
286 struct cs42l42_private *cs42l42 = dev_get_drvdata(&peripheral->dev); in cs42l42_sdw_init()
310 static int cs42l42_sdw_read_prop(struct sdw_slave *peripheral) in cs42l42_sdw_read_prop() argument
312 struct cs42l42_private *cs42l42 = dev_get_drvdata(&peripheral->dev); in cs42l42_sdw_read_prop()
313 struct sdw_slave_prop *prop = &peripheral->prop; in cs42l42_sdw_read_prop()
340 static int cs42l42_sdw_update_status(struct sdw_slave *peripheral, in cs42l42_sdw_update_status() argument
343 struct cs42l42_private *cs42l42 = dev_get_drvdata(&peripheral->dev); in cs42l42_sdw_update_status()
364 cs42l42_sdw_init(peripheral); in cs42l42_sdw_update_status()
386 static int cs42l42_sdw_bus_config(struct sdw_slave *peripheral, in cs42l42_sdw_bus_config() argument
389 struct cs42l42_private *cs42l42 = dev_get_drvdata(&peripheral->dev); in cs42l42_sdw_bus_config()
435 struct sdw_slave *peripheral = cs42l42->sdw_peripheral; in cs42l42_sdw_handle_unattach() local
437 if (!peripheral->unattach_request) in cs42l42_sdw_handle_unattach()
441 dev_dbg(&peripheral->dev, "Wait for initialization_complete\n"); in cs42l42_sdw_handle_unattach()
442 if (!wait_for_completion_timeout(&peripheral->initialization_complete, in cs42l42_sdw_handle_unattach()
444 dev_err(&peripheral->dev, "initialization_complete timed out\n"); in cs42l42_sdw_handle_unattach()
448 peripheral->unattach_request = 0; in cs42l42_sdw_handle_unattach()
516 static int cs42l42_sdw_probe(struct sdw_slave *peripheral, const struct sdw_device_id *id) in cs42l42_sdw_probe() argument
519 struct device *dev = &peripheral->dev; in cs42l42_sdw_probe()
547 regmap = devm_regmap_init(dev, NULL, peripheral, regmap_conf); in cs42l42_sdw_probe()
566 cs42l42->sdw_peripheral = peripheral; in cs42l42_sdw_probe()
588 static int cs42l42_sdw_remove(struct sdw_slave *peripheral) in cs42l42_sdw_remove() argument
590 struct cs42l42_private *cs42l42 = dev_get_drvdata(&peripheral->dev); in cs42l42_sdw_remove()