ASoC: rt5682: Implement remove callback

Let's implement a remove callback for this driver that's similar to the
shutdown hook, but also disables the regulators before they're put by
devm code.

Cc: Jairaj Arava <[email protected]>
Cc: Sathyanarayana Nujella <[email protected]>
Cc: Pierre-Louis Bossart <[email protected]>
Cc: Shuming Fan <[email protected]>
Cc: Ranjani Sridharan <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
Stephen Boyd authored and Mark Brown committed 2021-05-10 17:06:07 +01:00
1 parent 47bcb1c710
commit 87b42abae9
1 file changed
+11
+11
View File
@@ -280,6 +280,16 @@ static void rt5682_i2c_shutdown(struct i2c_client *client)
rt5682_reset(rt5682);
}
static int rt5682_i2c_remove(struct i2c_client *client)
{
struct rt5682_priv *rt5682 = i2c_get_clientdata(client);
rt5682_i2c_shutdown(client);
regulator_bulk_disable(ARRAY_SIZE(rt5682->supplies), rt5682->supplies);
return 0;
}
static const struct of_device_id rt5682_of_match[] = {
{.compatible = "realtek,rt5682i"},
{},
@@ -306,6 +316,7 @@ static struct i2c_driver rt5682_i2c_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
},
.probe = rt5682_i2c_probe,
.remove = rt5682_i2c_remove,
.shutdown = rt5682_i2c_shutdown,
.id_table = rt5682_i2c_id,
};