Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D3FEC433EF for ; Mon, 4 Apr 2022 16:16:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D9F6416B5; Mon, 4 Apr 2022 18:15:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D9F6416B5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1649088987; bh=m1mU6BlU2B4FGrW+3lCN164st5AaCcn5BL7QiunBPA8=; h=Date:Subject:To:References:From:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LVj1wNSGlOuCxezgu7VMak3SPL6DOkCetPqw4FrrD+X6ubChgEiC3tmMcUBl4JCFz 5Dm4MvMswS6eHKBHAfNbs9yIEbHakRiYH3cSkEUwY33YEjIgb8xFqqQZPR6a863wak 8misWLFNMdxT1kDitMNpRWl72sW0PWcais0MBc0Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5DAB1F8012C; Mon, 4 Apr 2022 18:15:37 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B70DCF80162; Mon, 4 Apr 2022 18:15:34 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C1D9FF8010B for ; Mon, 4 Apr 2022 18:15:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C1D9FF8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Pd+LCB7l" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649088929; x=1680624929; h=message-id:date:mime-version:subject:to:references:cc: from:in-reply-to:content-transfer-encoding; bh=m1mU6BlU2B4FGrW+3lCN164st5AaCcn5BL7QiunBPA8=; b=Pd+LCB7lZ1+FJ1lxeo78DFjGlC5V3hdnZCrU4YAkoQWoTs98YoR++NM0 sxvYfULQ6/rcnuYu1CUde65n8Y5cMCD2Ntn9tAbTXkeaQMnBExsNe8JBP oMAK5MGI0zqjE01SV3bHYWGcuDvd5I4tnnkQ5ho7qY3q5rpTtgnrkv/JP oTLL1RzhdTgLwkIotHzlOi+q5XcVfoPN7GpKY+pLvPOmp+iXsmjZdK2QM HU5r5EArpZ+3t+ZdAkx8BywN0kNJ0eu/a7ZpBkAdECOmozy8uIoklAFij pDgHqj89X6GEGGmEaPrBAcrEDpJmRqNvR5Cyz/9XqcQYU7wV3CR8kQXhp A==; X-IronPort-AV: E=McAfee;i="6200,9189,10307"; a="346991902" X-IronPort-AV: E=Sophos;i="5.90,234,1643702400"; d="scan'208";a="346991902" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2022 09:15:24 -0700 X-IronPort-AV: E=Sophos;i="5.90,234,1643702400"; d="scan'208";a="523636963" Received: from tpbigam-mobl1.amr.corp.intel.com (HELO [10.212.232.52]) ([10.212.232.52]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2022 09:15:23 -0700 Message-ID: <34a05d7b-ee42-acd2-56ea-f8adae74f169@linux.intel.com> Date: Mon, 4 Apr 2022 11:15:22 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.5.0 Subject: Re: [PATCH 1/1] ASoC: codecs: add support for ES8326 Content-Language: en-US To: "zhuning@everest-semi.com" , alsa-devel References: <2022032612075311484468@everest-semi.com> From: Pierre-Louis Bossart In-Reply-To: <2022032612075311484468@everest-semi.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Mark Brown , Takashi Iwai X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 3/25/22 23:07, zhuning@everest-semi.com wrote: > From 18deaac165343c049bb5ac7a71d222576caec9fc Mon Sep 17 00:00:00 2001 > From: yangxiaohua > Date: Thu, 10 Mar 2022 16:59:29 +0800 > Subject: [PATCH 1/1] ASoC: codecs: add support for ES8326 > > The ES8326 codec is not compatible with ES8316 and requires a dedicated driver. > > Signed-off-by: David Yang You need to copy maintainers (added in CC:), and you're also missing a Signed-off-by when sending patches developed by someone else. Also please use git send-email, it looks like the indentations were removed by your email client. > --- > sound/soc/codecs/Kconfig | 5 + > sound/soc/codecs/Makefile | 2 + > sound/soc/codecs/es8326.c | 753 ++++++++++++++++++++++++++++++++++++++ > sound/soc/codecs/es8326.h | 184 ++++++++++ > 4 files changed, 944 insertions(+) > create mode 100755 sound/soc/codecs/es8326.c > create mode 100755 sound/soc/codecs/es8326.h > > diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig > index c2627f7489a4..66bc2358e31e 100644 > --- a/sound/soc/codecs/Kconfig > +++ b/sound/soc/codecs/Kconfig > @@ -95,6 +95,7 @@ config SND_SOC_ALL_CODECS > imply SND_SOC_DA9055 > imply SND_SOC_DMIC > imply SND_SOC_ES8316 > + imply SND_SOC_ES8326 > imply SND_SOC_ES8328_SPI > imply SND_SOC_ES8328_I2C > imply SND_SOC_ES7134 > @@ -867,6 +868,10 @@ config SND_SOC_ES8316 > tristate "Everest Semi ES8316 CODEC" > depends on I2C > > +config SND_SOC_ES8326 > + tristate "Everest Semi ES8326 CODEC" > + depends on I2C > + > config SND_SOC_ES8328 > tristate > > diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile > index b4e11c3e4a08..73043d5bc1ea 100644 > --- a/sound/soc/codecs/Makefile > +++ b/sound/soc/codecs/Makefile > @@ -95,6 +95,7 @@ snd-soc-dmic-objs := dmic.o > snd-soc-es7134-objs := es7134.o > snd-soc-es7241-objs := es7241.o > snd-soc-es8316-objs := es8316.o > +snd-soc-es8326-objs := es8326.o > snd-soc-es8328-objs := es8328.o > snd-soc-es8328-i2c-objs := es8328-i2c.o > snd-soc-es8328-spi-objs := es8328-spi.o > @@ -437,6 +438,7 @@ obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o > obj-$(CONFIG_SND_SOC_ES7134) += snd-soc-es7134.o > obj-$(CONFIG_SND_SOC_ES7241) += snd-soc-es7241.o > obj-$(CONFIG_SND_SOC_ES8316) += snd-soc-es8316.o > +obj-$(CONFIG_SND_SOC_ES8326) += snd-soc-es8326.o > obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o > obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o > obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o > diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c > new file mode 100755 > index 000000000000..a80649e04aa6 > --- /dev/null > +++ b/sound/soc/codecs/es8326.c > @@ -0,0 +1,753 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * es8326.c -- es8326 ALSA SoC audio driver > + * Copyright Everest Semiconductor Co., Ltd > + * > + * Authors: David Yang > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include "es8326.h" > + > +struct es8326_priv { > + struct clk *mclk; > + struct snd_pcm_hw_constraint_list *sysclk_constraints; > + struct i2c_client *i2c; > + struct regmap *regmap; > + struct snd_soc_component *component; > + struct delayed_work jack_detect_work; > + bool amic; > + bool start; > + bool muted; > + bool hp_inserted; > + bool spk_gpio_level; > + bool hp_det_level; > + struct snd_soc_jack *jack; > + int irq; > + /* The lock protects the situation that an irq is generated > + * while the previous irq is still being processed. > + */ > + struct mutex lock; > + u8 amic1_src; > + u8 amic2_src; > + u8 mic1_src; > + u8 mic2_src; > + u8 jack_pol; > + bool jd_inverted; > + unsigned int sysclk; > +};