From: nickel@altlinux.org To: devel-kernel@lists.altlinux.org Cc: Vasily Vinogradov <v.vinogradov@aq.ru> Subject: [d-kernel] [PATCH 3/9] commit 8143959d503dd6b3c8b9802cee0f1eba82e8d844 Date: Mon, 4 Apr 2022 09:28:43 +0300 Message-ID: <20220404062849.1372967-5-nickel@altlinux.org> (raw) In-Reply-To: <20220404062849.1372967-2-nickel@altlinux.org> From: Vasily Vinogradov <v.vinogradov@aq.ru> ASoC: es8316: Add power management --- sound/soc/codecs/es8316.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c index 8f30a3ea8bfe..c63f3b300797 100644 --- a/sound/soc/codecs/es8316.c +++ b/sound/soc/codecs/es8316.c @@ -728,6 +728,8 @@ static int es8316_probe(struct snd_soc_component *component) return ret; } + snd_soc_component_init_regmap(component, es8316->regmap); + /* Reset codec and enable current state machine */ snd_soc_component_write(component, ES8316_RESET, 0x3f); usleep_range(5000, 5500); @@ -754,9 +756,43 @@ static void es8316_remove(struct snd_soc_component *component) { struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); + snd_soc_component_exit_regmap(component); + clk_disable_unprepare(es8316->mclk); } +#ifdef CONFIG_PM_SLEEP +static int es8316_suspend(struct device *dev) +{ + struct es8316_priv *es8316 = dev_get_drvdata(dev); + + dev_dbg(dev, "%s: Enter\n", __func__); + + regcache_cache_only(es8316->regmap, true); + regcache_mark_dirty(es8316->regmap); + + return 0; +} + +static int es8316_resume(struct device *dev) +{ + struct es8316_priv *es8316 = dev_get_drvdata(dev); + + dev_dbg(dev, "%s: Enter\n", __func__); + + regcache_cache_only(es8316->regmap, false); + regcache_sync(es8316->regmap); + + es8316_irq(es8316->irq, es8316); + + return 0; +} +#endif + +static const struct dev_pm_ops es8316_pm = { + SET_SYSTEM_SLEEP_PM_OPS(es8316_suspend, es8316_resume) +}; + static const struct snd_soc_component_driver soc_component_dev_es8316 = { .probe = es8316_probe, .remove = es8316_remove, @@ -787,6 +823,8 @@ static const struct regmap_config es8316_regmap = { .max_register = 0x53, .volatile_table = &es8316_volatile_table, .cache_type = REGCACHE_RBTREE, + .use_single_read = true, + .use_single_write = true, }; static int es8316_i2c_probe(struct i2c_client *i2c_client, @@ -851,6 +889,7 @@ static struct i2c_driver es8316_i2c_driver = { .name = "es8316", .acpi_match_table = ACPI_PTR(es8316_acpi_match), .of_match_table = of_match_ptr(es8316_of_match), + .pm = &es8316_pm, }, .probe = es8316_i2c_probe, .id_table = es8316_i2c_id, -- 2.33.0
next prev parent reply other threads:[~2022-04-04 6:28 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-04 6:28 [d-kernel] [PATCH 0/9] *** backport support for ES83x6 codec in I2S mode for CML/CNL platforms to 5.15.x *** nickel 2022-04-04 6:28 ` [d-kernel] (no subject) nickel 2022-04-04 6:28 ` [d-kernel] [PATCH 1/9] commit 0b220578c2aab3d5ac6b693117e8c5d22e8c2b34 nickel 2022-04-04 14:48 ` Vitaly Chikunov 2022-04-04 15:16 ` Nikolai Kostrigin 2022-04-07 11:15 ` [d-kernel] [PATCH v2 1/9] ASoC: Intel: add machine driver for SOF+ES8336 nickel 2022-04-07 11:15 ` [d-kernel] [PATCH v2 2/9] ASoC: Intel: sof_es8336: Add quirk for inverted jack detect nickel 2022-04-07 11:15 ` [d-kernel] [PATCH v2 3/9] ASoC: es8316: Add power management nickel 2022-04-07 11:15 ` [d-kernel] [PATCH v2 4/9] ASoC: es8316: Use increased GPIO debounce time nickel 2022-04-07 11:15 ` [d-kernel] [PATCH v2 5/9] ASoC: codec: es8326: New codec driver nickel 2022-04-07 11:15 ` [d-kernel] [PATCH v2 6/9] ALSA: intel-dspconfig: add ES8336 support for CNL nickel 2022-04-07 11:15 ` [d-kernel] [PATCH v2 7/9] ASoC: Intel: soc-acpi: add ESSX8336 support on Cannon Lake machines nickel 2022-04-07 11:15 ` [d-kernel] [PATCH v2 8/9] config: CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH=m nickel 2022-04-07 11:15 ` [d-kernel] [PATCH v2 9/9] ASoC: Intel: sof_es8336: add DMI info based pa-enable lookup quirk for CNL-LP models nickel 2022-04-07 19:32 ` [d-kernel] [PATCH v2 1/9] ASoC: Intel: add machine driver for SOF+ES8336 Vitaly Chikunov 2022-04-12 14:34 ` Nikolai Kostrigin 2022-04-14 8:43 ` Vitaly Chikunov 2022-04-14 8:48 ` Антон Мидюков 2022-04-14 8:52 ` Vitaly Chikunov 2022-04-14 8:55 ` Nikolai Kostrigin 2022-04-04 6:28 ` [d-kernel] [PATCH 2/9] commit 79b5808491cf152b808c51fecdafb221fa270cf1 nickel 2022-04-04 6:28 ` nickel [this message] 2022-04-04 6:28 ` [d-kernel] [PATCH 4/9] commit 796f9b0189299a221d4c822be216165dd2371852 nickel 2022-04-04 6:28 ` [d-kernel] [PATCH 5/9] commit f6a1611f744dcdd55c5adaf02f193083286dac34 nickel 2022-04-04 6:28 ` [d-kernel] [PATCH 6/9] ALSA: intel-dspconfig: add ES8336 support for CNL nickel 2022-04-04 6:28 ` [d-kernel] [PATCH 7/9] ASoC: Intel: soc-acpi: add ESSX8336 support on Cannon Lake machines nickel 2022-04-04 6:28 ` [d-kernel] [PATCH 8/9] config: CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH=m nickel 2022-04-04 6:28 ` [d-kernel] [PATCH 9/9] ASoC: Intel: sof_es8336: add DMI info based pa-enable lookup quirk for CNL-LP models nickel
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220404062849.1372967-5-nickel@altlinux.org \ --to=nickel@altlinux.org \ --cc=devel-kernel@lists.altlinux.org \ --cc=v.vinogradov@aq.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux kernel packages development This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \ devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com public-inbox-index devel-kernel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git