mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
mfd: cs42l43: Use new SoundWire enumeration helper
Now the new wait for SoundWire enumeration helper no longer depends on unattach_request it is safe to use from probe time. Update the driver to use the new core helper. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20260608102714.2503120-4-ckeepax@opensource.cirrus.com Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
parent
9bcc081252
commit
4d8ba321a7
|
|
@ -45,8 +45,6 @@ static int cs42l43_i2c_probe(struct i2c_client *i2c)
|
|||
|
||||
cs42l43->dev = &i2c->dev;
|
||||
cs42l43->irq = i2c->irq;
|
||||
/* A device on an I2C is always attached by definition. */
|
||||
cs42l43->attached = true;
|
||||
cs42l43->variant_id = (long)device_get_match_data(cs42l43->dev);
|
||||
|
||||
cs42l43->regmap = devm_regmap_init_i2c(i2c, &cs42l43_i2c_regmap);
|
||||
|
|
|
|||
|
|
@ -100,17 +100,10 @@ static int cs42l43_sdw_update_status(struct sdw_slave *sdw, enum sdw_slave_statu
|
|||
|
||||
sdw_write_no_pm(sdw, CS42L43_GEN_INT_MASK_1,
|
||||
CS42L43_INT_STAT_GEN1_MASK);
|
||||
|
||||
cs42l43->attached = true;
|
||||
|
||||
complete(&cs42l43->device_attach);
|
||||
break;
|
||||
case SDW_SLAVE_UNATTACHED:
|
||||
dev_dbg(cs42l43->dev, "Device detach\n");
|
||||
|
||||
cs42l43->attached = false;
|
||||
|
||||
reinit_completion(&cs42l43->device_attach);
|
||||
complete(&cs42l43->device_detach);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -586,15 +586,13 @@ static int cs42l43_soft_reset(struct cs42l43 *cs42l43)
|
|||
*/
|
||||
static int cs42l43_wait_for_attach(struct cs42l43 *cs42l43)
|
||||
{
|
||||
if (!cs42l43->attached) {
|
||||
unsigned long timeout = msecs_to_jiffies(CS42L43_SDW_ATTACH_TIMEOUT_MS);
|
||||
unsigned long time;
|
||||
int ret;
|
||||
|
||||
time = wait_for_completion_timeout(&cs42l43->device_attach, timeout);
|
||||
if (!time) {
|
||||
dev_err(cs42l43->dev, "Timed out waiting for device re-attach\n");
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
if (cs42l43->sdw) {
|
||||
ret = sdw_slave_wait_for_init(cs42l43->sdw,
|
||||
CS42L43_SDW_ATTACH_TIMEOUT_MS);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
regcache_cache_only(cs42l43->regmap, false);
|
||||
|
|
@ -1120,7 +1118,6 @@ int cs42l43_dev_probe(struct cs42l43 *cs42l43)
|
|||
dev_set_drvdata(cs42l43->dev, cs42l43);
|
||||
|
||||
mutex_init(&cs42l43->pll_lock);
|
||||
init_completion(&cs42l43->device_attach);
|
||||
init_completion(&cs42l43->device_detach);
|
||||
init_completion(&cs42l43->firmware_download);
|
||||
INIT_WORK(&cs42l43->boot_work, cs42l43_boot_work);
|
||||
|
|
|
|||
|
|
@ -86,7 +86,6 @@ struct cs42l43 {
|
|||
struct regmap_irq_chip_data *irq_data;
|
||||
|
||||
struct work_struct boot_work;
|
||||
struct completion device_attach;
|
||||
struct completion device_detach;
|
||||
struct completion firmware_download;
|
||||
int firmware_error;
|
||||
|
|
@ -96,7 +95,6 @@ struct cs42l43 {
|
|||
struct mutex pll_lock;
|
||||
|
||||
bool sdw_pll_active;
|
||||
bool attached;
|
||||
bool hw_lock;
|
||||
long variant_id;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user