From patchwork Mon Feb 18 16:10:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 10818461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE6ED6CB for ; Mon, 18 Feb 2019 16:49:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8BF829CCD for ; Mon, 18 Feb 2019 16:49:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D3FC29CDA; Mon, 18 Feb 2019 16:49:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5B0F29D90 for ; Mon, 18 Feb 2019 16:49:11 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CE95526552B; Mon, 18 Feb 2019 17:10:37 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C2E3B26552C; Mon, 18 Feb 2019 17:10:35 +0100 (CET) Received: from esa1.microchip.iphmx.com (esa1.microchip.iphmx.com [68.232.147.91]) by alsa0.perex.cz (Postfix) with ESMTP id D5EC026552A for ; Mon, 18 Feb 2019 17:10:32 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.58,385,1544511600"; d="scan'208";a="27906366" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Feb 2019 09:10:30 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.49) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 18 Feb 2019 09:10:30 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sgZGsr0wyVXcuf+ruQyQVw08DNH4i17utmx7bVVuKd4=; b=tIk25BrYqNl6Qc6vIVpRGp2QDFzVQrZ8xp8GVsgaHB8YlqhREDP47EUz9pYKlHUhHg5M3G9HkZM4uE7VAtrtP+mxcGIbfIODEW1D6egpGt83Od7xl7b6/a8yc6xzApTV3vCqBUYYK2w8FHMv0qX4buKQc5NdtLcRJcEW/qe6Igg= Received: from CY4PR11MB1256.namprd11.prod.outlook.com (10.169.252.10) by CY4PR11MB1448.namprd11.prod.outlook.com (10.172.69.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Mon, 18 Feb 2019 16:10:28 +0000 Received: from CY4PR11MB1256.namprd11.prod.outlook.com ([fe80::d9cc:7741:4930:cda3]) by CY4PR11MB1256.namprd11.prod.outlook.com ([fe80::d9cc:7741:4930:cda3%7]) with mapi id 15.20.1622.018; Mon, 18 Feb 2019 16:10:28 +0000 From: To: , , Thread-Topic: [PATCH 1/5] ASoC: codecs: ad193x: Remove capture support for codecs without ADC Thread-Index: AQHUx6R2TxqbrV0Takq7kytYHJYBBw== Date: Mon, 18 Feb 2019 16:10:28 +0000 Message-ID: <20190218160954.13929-2-codrin.ciubotariu@microchip.com> References: <20190218160954.13929-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20190218160954.13929-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P123CA0020.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:a6::32) To CY4PR11MB1256.namprd11.prod.outlook.com (2603:10b6:903:25::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Codrin.Ciubotariu@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3b247116-e956-4b56-1ccb-08d695bb9923 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:CY4PR11MB1448; x-ms-traffictypediagnostic: CY4PR11MB1448: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; CY4PR11MB1448; 23:X+Nk0DOXv6BlQUg5dsUhHW0aUNev0xYlykMybG9?= =?iso-8859-1?q?VrQNWrO0hozbJJG?= =?iso-8859-1?q?HBNeWUP/QrQDLHBmOZYlaPslfklXah7MzDNAQIctx1P1NiD8OvlvBOrjSljL?= =?iso-8859-1?q?Z6c4DHZXLFNGX8mrAbS0qQ9HapX53CT/BXxRTMoHFlsz7lp9425NsxDoKRrd?= =?iso-8859-1?q?U6zX5VyBeF7kWRiLbC6IAG31Ek7RW/A/tgF3cPJMh/b7qVkLstuzSPRPaAlW?= =?iso-8859-1?q?01SCoqTu6JqquY0/C+PWeC4TuGP9rtR9Sy39Y2Oe05ENDMPxdW7zKoCLqoCu?= =?iso-8859-1?q?SvKyI3PhwbGtyEnArqojimrz4aT+oIFzCcu+F7aICoKCf9cCStCG8yvWdi0N?= =?iso-8859-1?q?SR0Ab4O3R6/DmcsEj3sZ9V1QuS6xwZrHDMMD5UCyFNvzGeAiH9Qq66xrx8g4?= =?iso-8859-1?q?eX+TL1Js38dCQvbJwca9kd6KRtW+PrLwEzpeuLSqyeohahzS6Hcbf/qpkCb6?= =?iso-8859-1?q?O+78QSMq567Uu/BMOTPPW877bTCepWUMLIp4RClZoR7KqyK+zJs5/c/4dmEP?= =?iso-8859-1?q?GOHhD9XUZwMZP8HoV6br5mk11PgOEZtXd37rRK43fCvc2/qGd9GKli2QrCAF?= =?iso-8859-1?q?dnon/gp+gqsy2NVyktFJS0KycHLAkZ9MWn1ZwTrkgckoOE7lh5wGecmQ4ek6?= =?iso-8859-1?q?agIe05KezLS7VxCvfSBf5JOxUQABFYVgwGEQIGxvdOh7ySg/GBMl20h4B9MU?= =?iso-8859-1?q?S5qMmM8QanEGtaz1btC/O8Wk1Lcds+Ei36khY+oiUm9wXeZBhNCR7crW5YGj?= =?iso-8859-1?q?rO9emFjx4f8iGHL6GXBFU/p80qT7aNM0hiUaVWZEkRWDffvcexLRfQ6qDtKC?= =?iso-8859-1?q?c33660vfXYNGd9w1nE1KL8b9Vc8fssso7vA2cAQYJkJ43+PjLPhAqgMx5CVj?= =?iso-8859-1?q?NTeLnSQv7s5iodg0pk4NwgqnXVJbAzvyt9FsOiBRcaYLiEkQKnsYNOiW6TWG?= =?iso-8859-1?q?z+JeWh4wiEcJfVu4O5O/paJ1mZOHz5B9OayLDVw5Q0aK3DPSNc6AR6rxltfX?= =?iso-8859-1?q?xx7hu5oFPECSD59XVMLegrQ7XP3qshs3DsgcEi2arRzJUjxX0TLAS5vU3ylK?= =?iso-8859-1?q?/TLeVZdC6HW5qwyuXjQy94j2B4wZSFFaFlxOp5Cm/md340D00a9YmI2i0RhR?= =?iso-8859-1?q?0lDGh0n2KUlgul48+5nxL+aITHIENBKUDXDBhEEHAtctQBN4jhn2XJNu5zs6?= =?iso-8859-1?q?NvC++ubJPqSB2zhy70c2fDD3HrlEyBe3tC6qlfvmYPVUXZCGsJh2ZXrTpjLx?= =?iso-8859-1?q?D6eZQMC7jGv8f7mQ1gW5wlbnmL6TyLQ4tvOslIq+UxwaT452qF1FNea7Ymdl?= =?iso-8859-1?q?+meHOrfa0=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09525C61DB x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(136003)(376002)(39860400002)(199004)(189003)(110136005)(256004)(11346002)(52116002)(446003)(76176011)(386003)(8936002)(99286004)(54906003)(1076003)(316002)(2616005)(14444005)(106356001)(305945005)(186003)(97736004)(105586002)(476003)(36756003)(26005)(486006)(53936002)(107886003)(66066001)(71200400001)(71190400001)(6506007)(81166006)(6436002)(81156014)(25786009)(8676002)(2201001)(478600001)(6512007)(4326008)(2501003)(14454004)(50226002)(2906002)(6116002)(3846002)(86362001)(68736007)(6486002)(7736002)(102836004)(72206003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR11MB1448; H:CY4PR11MB1256.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: nDJwqf6G/UAW/rhMz8AsayTfXkdGPQ6HSBGCKXyZ4LvqPFKNdv0LmZVXMYbpzMkaY/5W03ZTWwQe6hEw8OddBSuqFjZcItqcCrSHvHZxwnxxe+J7bKIA2LuJENd3vvbowuSvpGnnWNlf1imDZVSxYLbO3k25HfyqKG3Tr8QZrBqKI2cgcKLI9ixkxRgTyOxOU/v3zY1jh0n0INBA+EXosFraZi2bZ/cmR1X63pThqR5cZVXSqeqfS9tTSmClhDiaWLyOfb6K9AjqE9gEh2RiibcCZzWHbtDXZ7soK+A/mecSd3YZbx6kOlslnCQZ3RCwep+j49yN9HXNNuoO+/1Admastdw30ROlv4MjDNRiHSquZjzR/wvDlJLoBN/BPiUqWjxkGIb7E1vxyfFs3wcApJquP38GTRIKT4ydDaEKs5g= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3b247116-e956-4b56-1ccb-08d695bb9923 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2019 16:10:26.6120 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1448 X-OriginatorOrg: microchip.com Cc: alsa-devel@alsa-project.org, Codrin.Ciubotariu@microchip.com, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 1/5] ASoC: codecs: ad193x: Remove capture support for codecs without ADC X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Codrin Ciubotariu Some ad193x codecs don't have ADCs, so they have no capture capabilities. This way, we can use this driver in multicodec cards. Signed-off-by: Codrin Ciubotariu --- sound/soc/codecs/ad193x.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index 4b60ebee491d..21a38cc9e3da 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c @@ -351,6 +351,20 @@ static struct snd_soc_dai_driver ad193x_dai = { .ops = &ad193x_dai_ops, }; +/* codec DAI instance for DAC only */ +static struct snd_soc_dai_driver ad193x_no_adc_dai = { + .name = "ad193x-hifi", + .playback = { + .stream_name = "Playback", + .channels_min = 2, + .channels_max = 8, + .rates = SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE, + }, + .ops = &ad193x_dai_ops, +}; + static int ad193x_component_probe(struct snd_soc_component *component) { struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(component); @@ -444,8 +458,11 @@ int ad193x_probe(struct device *dev, struct regmap *regmap, dev_set_drvdata(dev, ad193x); + if (ad193x_has_adc(ad193x)) + return devm_snd_soc_register_component(dev, &soc_component_dev_ad193x, + &ad193x_dai, 1); return devm_snd_soc_register_component(dev, &soc_component_dev_ad193x, - &ad193x_dai, 1); + &ad193x_no_adc_dai, 1); } EXPORT_SYMBOL_GPL(ad193x_probe); From patchwork Mon Feb 18 16:10:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 10818457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A13417FB for ; Mon, 18 Feb 2019 16:49:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0578329CCD for ; Mon, 18 Feb 2019 16:49:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED6F129D97; Mon, 18 Feb 2019 16:49:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 963F629CE1 for ; Mon, 18 Feb 2019 16:49:10 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BBF82265555; Mon, 18 Feb 2019 17:11:08 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D8654265550; Mon, 18 Feb 2019 17:11:05 +0100 (CET) Received: from esa4.microchip.iphmx.com (esa4.microchip.iphmx.com [68.232.154.123]) by alsa0.perex.cz (Postfix) with ESMTP id BD829265552 for ; Mon, 18 Feb 2019 17:10:59 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.58,385,1544511600"; d="scan'208";a="26476881" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Feb 2019 09:10:41 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.105) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 18 Feb 2019 09:10:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I9ZaDRCEoYFfX+kcNM+XYkG2iwAk6Swvbp+2RXTN38I=; b=JTALc9kwHwid/WGi9UUYOZn8FjKq8kIJIpwYz5FoY3aNzNAfoTT4b+SjwzE7But47RKANkY1mOKl5wTLmwOzyy9RnaXbB6tBUjc6loIC8HcBXIY09bbfVu2XOL1YKpH2usJVYaSfkf1IeoU3FXUzBoLgsLmBcvWx/SQ7rxEHeX4= Received: from CY4PR11MB1256.namprd11.prod.outlook.com (10.169.252.10) by CY4PR11MB1448.namprd11.prod.outlook.com (10.172.69.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Mon, 18 Feb 2019 16:10:30 +0000 Received: from CY4PR11MB1256.namprd11.prod.outlook.com ([fe80::d9cc:7741:4930:cda3]) by CY4PR11MB1256.namprd11.prod.outlook.com ([fe80::d9cc:7741:4930:cda3%7]) with mapi id 15.20.1622.018; Mon, 18 Feb 2019 16:10:30 +0000 From: To: , , Thread-Topic: [PATCH 2/5] ASoC: codecs: ad193x: Set constraint to always have 32 sample bits Thread-Index: AQHUx6R42/w2rhtso0esi+FU0VrYpA== Date: Mon, 18 Feb 2019 16:10:30 +0000 Message-ID: <20190218160954.13929-3-codrin.ciubotariu@microchip.com> References: <20190218160954.13929-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20190218160954.13929-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P123CA0020.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:a6::32) To CY4PR11MB1256.namprd11.prod.outlook.com (2603:10b6:903:25::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Codrin.Ciubotariu@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f580ef44-8e74-4f99-689d-08d695bb9a47 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:CY4PR11MB1448; x-ms-traffictypediagnostic: CY4PR11MB1448: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; CY4PR11MB1448; 23:mLpCz3nCOH+ST4chE9bYqC4+uziXVenDxxzVRlt?= =?iso-8859-1?q?lXIxgOKS6LIdDL3?= =?iso-8859-1?q?i2QMhd86L5jeIXFHQEarO5r2PYDVWFIAe2mksIusQ3wrRqI3dss0taoTwAx0?= =?iso-8859-1?q?F/TK/y89JL3YqAE+nNm5ip9BCPypwHAPlrRyFt6Q/prIEfTOz1HPhkh/HdTj?= =?iso-8859-1?q?GHMvhSVg8vEsCjKTftukQyQPqZsVmZrLUT1/JSO+RW/HjEC1d2H9fwQyrK35?= =?iso-8859-1?q?r561kX65T81XkuipNX8OYMz+mtTAMzG8eynV6JDhj5Icn4WVR1tqpxgmrMXI?= =?iso-8859-1?q?QUHByakz3oYdJgo717xPmFb0xGRYLpuAK0xP80uS3F0n+vKgU1LujZeFCiH4?= =?iso-8859-1?q?C1Zmz8ObCaW5+vVC4pl3M2iM9CYj50HKv76DuukWa8wPDlWaUcGoMSRCUQ1L?= =?iso-8859-1?q?ps5lj8tNdWLHe9h5eYNjQpYYbkrEUPosdMTubl2UptJYvcN00ti8Yelr2nrL?= =?iso-8859-1?q?2o2TvMP+MZu1vufZzuyJRh4LDQzRZoXC1Zat1IS+RQlhi8iGymBer4zWJFit?= =?iso-8859-1?q?SQT2u/FzTKMsIc7gxTkr6C7kbIzNp0zFeiuileaE2lpHjNNJ1lOD1Vm2fpa0?= =?iso-8859-1?q?s6XA/xlOKpS2FBTXzeNPEa3+qdHhqMIqaO7IdBqt8DEYeJ2Ge75BnZk+75yv?= =?iso-8859-1?q?Ce19wao/v3BtKsUW/v1RAquBr4sey0nAaI5paX+XSolV6s9hR91hoq0q3U1j?= =?iso-8859-1?q?8P9MZAbrWVNV7nJMPncgiAyX5z+D44ARFHRnjiPW7Yp3aXqAd0ln/W8CuVGV?= =?iso-8859-1?q?D3janVBiirIkdg7u4NhuX4bnwG972ZOPeM8lap/6V5WUtrpbl6rJRKaf1ViF?= =?iso-8859-1?q?I3NEwKOhBRPbPKGT+VOl2b8FniKei2bth7WyqfmA0P4G6881l25xWsusrz5E?= =?iso-8859-1?q?+369zegVyQv/72IbfZ/Zp6P3cSNph5urr3nS9LZSva3mBqG1rIj4JS1e9CJu?= =?iso-8859-1?q?VG8is2Hf6TwT7cFrLcWYQ/32Yb9+USKQuTiFwLiBjAem2iDZPlKbuEz4c+Jk?= =?iso-8859-1?q?G4lhD2XUTc9K8qIBSvpKyGL3VPnoX/U/2y1PNHG5wyeyG41dq1mG4ZVmexUA?= =?iso-8859-1?q?XDnCe6CRYfOR1EqW1Kar3qYT33Ockj5hTEJDWNYGge+hfEkVE7QsMQFiYcDJ?= =?iso-8859-1?q?N0kcG7jcAplQTzloBg7rXD2NbYgZACC2p3/YsitrEepPHaMNs0g3C7MxAnLw?= =?iso-8859-1?q?/5OqhruGHG1z7EgsuQ33qXTReZfm+/dGsfw/TG/qo8GhIFZn5EZkvvGLIQpt?= =?iso-8859-1?q?PJYXfRf9kEQPBMYnUCBOA9OsR7Wjjv/2VX3bH1jYYhIJR/0Q=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09525C61DB x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(136003)(376002)(39860400002)(199004)(189003)(110136005)(256004)(11346002)(52116002)(446003)(76176011)(386003)(8936002)(99286004)(54906003)(1076003)(316002)(2616005)(106356001)(305945005)(186003)(97736004)(105586002)(476003)(36756003)(26005)(486006)(53936002)(107886003)(66066001)(71200400001)(71190400001)(6506007)(81166006)(6436002)(81156014)(25786009)(8676002)(2201001)(478600001)(6512007)(4326008)(2501003)(14454004)(50226002)(2906002)(6116002)(3846002)(86362001)(68736007)(6486002)(7736002)(102836004)(72206003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR11MB1448; H:CY4PR11MB1256.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: SoqFsN+PefEPY3jpOMTCa7SNFxft/8n5tBtPwCVDCQHk3p7QOA2lGo2NJwjgzWJ5TNcSLvXA/szMpnLWQurvvrS6H7yQU6m6egBLpQsCcObBGwiJOyQAZtjF7cxy3m7tjNLZgs3kV2ToCaGidi7Q9BYHpBupNo1jmul96ApWxW6a7wrlkFtUUc6rIGlPUUuR++AthXkd8TA5kzWAfsKC9Vllm9+zGpY/09R/pR6/Zjo+qhyJ+q0tpIJScuOXUJDFR53tm1is2SKGqonSMKF8fzcoQ27xtLsAEMjT57/1rkP1elgLWPT0zqB4UaXT78iQmyFZpk4M3rCpz6QBte1GHowc8KS7WcvcEW2tX7FYcyc1pMN0HCR3rCIaBll3ARYEWEImrr7FbeWVz8OMIdnY1AojMS2tKJHvpVxvN0p7N8c= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f580ef44-8e74-4f99-689d-08d695bb9a47 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2019 16:10:28.5516 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1448 X-OriginatorOrg: microchip.com Cc: alsa-devel@alsa-project.org, Codrin.Ciubotariu@microchip.com, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 2/5] ASoC: codecs: ad193x: Set constraint to always have 32 sample bits X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Codrin Ciubotariu DACs and ADCs on ad193x codecs require a 32 bit slot size. We should assure that no other size is used. Signed-off-by: Codrin Ciubotariu --- sound/soc/codecs/ad193x.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index 21a38cc9e3da..c16c9969d1a0 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c @@ -37,6 +37,13 @@ static SOC_ENUM_SINGLE_DECL(ad193x_deemp_enum, AD193X_DAC_CTRL2, 1, static const DECLARE_TLV_DB_MINMAX(adau193x_tlv, -9563, 0); +static const unsigned int ad193x_sb[] = {32}; + +static struct snd_pcm_hw_constraint_list constr = { + .list = ad193x_sb, + .count = ARRAY_SIZE(ad193x_sb), +}; + static const struct snd_kcontrol_new ad193x_snd_controls[] = { /* DAC volume control */ SOC_DOUBLE_R_TLV("DAC1 Volume", AD193X_DAC_L1_VOL, @@ -321,7 +328,16 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream, return 0; } +static int ad193x_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + return snd_pcm_hw_constraint_list(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_SAMPLE_BITS, + &constr); +} + static const struct snd_soc_dai_ops ad193x_dai_ops = { + .startup = ad193x_startup, .hw_params = ad193x_hw_params, .digital_mute = ad193x_mute, .set_tdm_slot = ad193x_set_tdm_slot, From patchwork Mon Feb 18 16:10:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 10818465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 226606CB for ; Mon, 18 Feb 2019 16:49:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CFEB29CCD for ; Mon, 18 Feb 2019 16:49:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0195B29CDA; Mon, 18 Feb 2019 16:49:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DD2E29CF2 for ; Mon, 18 Feb 2019 16:49:10 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4F9EE265531; Mon, 18 Feb 2019 17:10:48 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 50B00265532; Mon, 18 Feb 2019 17:10:45 +0100 (CET) Received: from esa1.microchip.iphmx.com (esa1.microchip.iphmx.com [68.232.147.91]) by alsa0.perex.cz (Postfix) with ESMTP id 6320E26552A for ; Mon, 18 Feb 2019 17:10:42 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.58,385,1544511600"; d="scan'208";a="27906383" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Feb 2019 09:10:41 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.105) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 18 Feb 2019 09:10:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7Ez82SpYZyAIQ5xL0qCMe79umRSp3574m5ZKRTm5DPk=; b=nBW1xAQ3Pc1bJxvTDeja+tMdONE/odlp2LyfX1tC4tk2M5hUwe9qfb7G3Jjhuzmv0X1zsrkeOjg+fbwk7UDKu0QdhQUIdnTN3SEBt+7sCOf6D0LXOHJz6Z7AeUnGi0YZ0/d/VAzz5D+Sert0mgvVSLksAEQ4YNq+S0nfB8leDqg= Received: from CY4PR11MB1256.namprd11.prod.outlook.com (10.169.252.10) by CY4PR11MB1448.namprd11.prod.outlook.com (10.172.69.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Mon, 18 Feb 2019 16:10:32 +0000 Received: from CY4PR11MB1256.namprd11.prod.outlook.com ([fe80::d9cc:7741:4930:cda3]) by CY4PR11MB1256.namprd11.prod.outlook.com ([fe80::d9cc:7741:4930:cda3%7]) with mapi id 15.20.1622.018; Mon, 18 Feb 2019 16:10:32 +0000 From: To: , , Thread-Topic: [PATCH 3/5] ASoC: codecs: ad193x: Fix frame polarity for DSP_A format Thread-Index: AQHUx6R5fns+sZxD40mSbyebg3U5XQ== Date: Mon, 18 Feb 2019 16:10:32 +0000 Message-ID: <20190218160954.13929-4-codrin.ciubotariu@microchip.com> References: <20190218160954.13929-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20190218160954.13929-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P123CA0020.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:a6::32) To CY4PR11MB1256.namprd11.prod.outlook.com (2603:10b6:903:25::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Codrin.Ciubotariu@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8290a2d5-538f-4403-6029-08d695bb9b83 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:CY4PR11MB1448; x-ms-traffictypediagnostic: CY4PR11MB1448: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; CY4PR11MB1448; 23:lhzKQUJi6lLKWihKRtSSxi6B6pB1BI4ipbEsOQS?= =?iso-8859-1?q?p5PeouybyVlp5+x?= =?iso-8859-1?q?l3/UVWSgPmiuK25mfzLeVm7jUfbkFkR7NS98fWbvQb37iKM8bSysSjztt7B6?= =?iso-8859-1?q?6xv2xOLeIFg2MMGMVtu4gKLhPHkLkyQI/8rEXIDwqRsPgQeNYhGwq6RgUZNp?= =?iso-8859-1?q?KDFWA/DG5j4gxopugXWIME7LO7nC1peapejQvuEw80hp3+lwVLHHrSYo8ysU?= =?iso-8859-1?q?ao4jGZzmYngg3BtyZIHWoiW6maJmnuKXZEZBxsvjX0bpRtdo5EU4Ki8MjmKu?= =?iso-8859-1?q?iLZUiG4DM6c31USFGmwBI1OLfzGS/1iZEkGmPqXDlqi8u30MvgG4Dvc6OnvQ?= =?iso-8859-1?q?XnCxEP3PgyK/A3RembkRuZXcUVJfL/QSGZSLFgCKep2fDl8P9WhqimyKo18b?= =?iso-8859-1?q?3YWSL6rOk87vanEkgfIKGDBNEkAkXlML0Y9RSw4q9SNOT4tS7GWhugholkhK?= =?iso-8859-1?q?WbKCAl3XgW+7KSj2DduOQM8cSPPB0ROJGqjhHSpDDl5itxe/aaG0p2PE4htA?= =?iso-8859-1?q?+X7B9BlA1gSq5IuJpLdXWRMAaPhGI+HJkBNUslNht/2T5t4ZIF6/Xn98ebNC?= =?iso-8859-1?q?FPNUmZ1w9vVHUSw2yzn8aYV+vE9GLQwqwPdnd7GP5c1lXzsk9J9+TX8HqZWa?= =?iso-8859-1?q?2NpT8FwxayzNKHejxr7DIQCMzH94BWlD6FOqfxV1x26Be3xTtOteS1mpFYtH?= =?iso-8859-1?q?q+U8NKjl4oDFiTX7yjyInlQgC6JtfIhjxXJ5KzXlq+sGn45fbRG+Q7cR++zR?= =?iso-8859-1?q?TYei734zshc92xJLYukHDXLlESN05Dw48MBx/kANb4MVLqJKdCYK7s16pY65?= =?iso-8859-1?q?ZXkNOV/TVcCX6y5TrbbcVlqEM9h+yXe13xBtTFhhcVX8r5LOE4uA+xH6X/9W?= =?iso-8859-1?q?JqUHswz7glE0bWOgCWGgiDEVQ+YC3hUsVnkUJiHZZUq6jOG50+NbGl7NYbwS?= =?iso-8859-1?q?mRLyj9iAsdFHBHLDv7zLM8Vo5n87N1Dy8aA/erkcX1ncexijPLkFQ00JCdCF?= =?iso-8859-1?q?XJRlC+7S/0jltWDrnqmvRqwPUfRe33LDdra2L/RtZqkCnSeMc0gqdhWjCzOZ?= =?iso-8859-1?q?XfjfUo2GkBHs/hEjeYZSF6E+q7hzUCB4NU8gYwSII5PLN+5iLutYg2nKJv8s?= =?iso-8859-1?q?T2YQWB47vaMgHIG2J/k03cs39m3avfmcQ5W5is93vFdExhVk2ErbAtSP0noa?= =?iso-8859-1?q?wX2B8eCkyB6iScBLXK9Sq43Nx5MKv3/yXwAykdSTAKTZ5BjGKXMg59G6/WcP?= =?iso-8859-1?q?taX7az4cqIItSOjbGSwn25TzuE02ajrum/Gh11GE5LM5o4MKLFB9oA9T2HM6?= =?iso-8859-1?q?HtCU3CTCs=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09525C61DB x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(136003)(376002)(39860400002)(199004)(189003)(110136005)(256004)(11346002)(52116002)(446003)(76176011)(386003)(8936002)(99286004)(54906003)(1076003)(316002)(2616005)(106356001)(305945005)(186003)(97736004)(105586002)(476003)(36756003)(26005)(486006)(53936002)(107886003)(66066001)(71200400001)(71190400001)(6506007)(81166006)(6436002)(81156014)(25786009)(8676002)(2201001)(478600001)(6512007)(4326008)(2501003)(14454004)(50226002)(2906002)(6116002)(3846002)(86362001)(68736007)(6486002)(7736002)(4744005)(102836004)(72206003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR11MB1448; H:CY4PR11MB1256.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: e8wmC1igKJ9cJX1Pd1eOmfRUu9c3QPCqjh+IqA5Bah/DYKpP4m1dkRScn5VCE0stXZH9DX3zglytvHJYaZy5XqxVQDj48vmhlaDZMbUy98Cgi2I6siLt+bk8w1Cs3epUvjD01p07y/a4cRhPiU/GDAAkidqX4fWhCjvpvvKH+3vrqlO6pO6I12vo+UTVyF7bMT8Ni5vQ5WVLTxCwkPkDvVDw/BDX0YL+deKzjRD0ME/b5iSSWyLneILfZcTBFIcNeOYZXjOnW1PyXDbhnN+cI9yWyp4sp4SFggOrEIVZ8XOtMy6FTIIGAybaNOp0cr9CA+hZ1bnLDZcGIYsbEYCo9l7oYdL2D/HFmo17PVyx/5Hg64a0WOBCjuSqXOVVxJgwK+hWyjswV4cfyY4qlgAyvc8lnVTnefYegDMOJJLqTWk= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 8290a2d5-538f-4403-6029-08d695bb9b83 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2019 16:10:30.6003 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1448 X-OriginatorOrg: microchip.com Cc: alsa-devel@alsa-project.org, Codrin.Ciubotariu@microchip.com, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 3/5] ASoC: codecs: ad193x: Fix frame polarity for DSP_A format X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Codrin Ciubotariu By default, the codec starts to interpret the left (first) channel on the falling edge (low polarity) of LRCLK. However, for DSP_A, the left channel needs to start on the rising edge of LRCLK. This patch fixes this channel swap by toggling the bit which selects the LRCLK polarity. Signed-off-by: Codrin Ciubotariu --- sound/soc/codecs/ad193x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index c16c9969d1a0..315ec9775118 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c @@ -228,6 +228,12 @@ static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai, return -EINVAL; } + /* For DSP_*, LRCLK's polarity must be inverted */ + if (fmt & SND_SOC_DAIFMT_DSP_A) { + change_bit(ffs(AD193X_DAC_LEFT_HIGH) - 1, + (unsigned long *)&dac_fmt); + } + switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBM_CFM: /* codec clk & frm master */ adc_fmt |= AD193X_ADC_LCR_MASTER; From patchwork Mon Feb 18 16:10:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 10818455 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D22636CB for ; Mon, 18 Feb 2019 16:49:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B803B29D1C for ; Mon, 18 Feb 2019 16:49:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6A8E29CCD; Mon, 18 Feb 2019 16:49:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91B4D29CCD for ; Mon, 18 Feb 2019 16:49:10 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6DE9426555C; Mon, 18 Feb 2019 17:11:10 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E4473265550; Mon, 18 Feb 2019 17:11:06 +0100 (CET) Received: from esa4.microchip.iphmx.com (esa4.microchip.iphmx.com [68.232.154.123]) by alsa0.perex.cz (Postfix) with ESMTP id BE05926553F for ; Mon, 18 Feb 2019 17:11:01 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.58,385,1544511600"; d="scan'208";a="26476886" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Feb 2019 09:10:42 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.105) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 18 Feb 2019 09:10:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B3vACndhHznrL0TehhaEpBgute3q4UvGqaVmr38xUM0=; b=jZ6mIc93R6itx2ESbLZc49LWVCPsO0CoqXiGBTN/imLdOVIrxD0bBWz6cqtZtNoio6rNsibi+5FtAab+CxupPTFIGoc7R7UnpJ0Zj68gF9LYCa4ZXuPabgrSr6pvQvESQuA8Fg+mC1VCHnHQQjCgvmDUpo+oWNoclx/ptnPAYPc= Received: from CY4PR11MB1256.namprd11.prod.outlook.com (10.169.252.10) by CY4PR11MB1448.namprd11.prod.outlook.com (10.172.69.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Mon, 18 Feb 2019 16:10:34 +0000 Received: from CY4PR11MB1256.namprd11.prod.outlook.com ([fe80::d9cc:7741:4930:cda3]) by CY4PR11MB1256.namprd11.prod.outlook.com ([fe80::d9cc:7741:4930:cda3%7]) with mapi id 15.20.1622.018; Mon, 18 Feb 2019 16:10:34 +0000 From: To: , , Thread-Topic: [PATCH 4/5] ASoC: codecs: ad193x: Add runtime support for DSP_A and I2S modes Thread-Index: AQHUx6R64TVvlpVi4U2qyYqN379Pew== Date: Mon, 18 Feb 2019 16:10:34 +0000 Message-ID: <20190218160954.13929-5-codrin.ciubotariu@microchip.com> References: <20190218160954.13929-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20190218160954.13929-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P123CA0020.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:a6::32) To CY4PR11MB1256.namprd11.prod.outlook.com (2603:10b6:903:25::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Codrin.Ciubotariu@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 109e64c2-a0bc-4c40-5310-08d695bb9ceb x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:CY4PR11MB1448; x-ms-traffictypediagnostic: CY4PR11MB1448: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; CY4PR11MB1448; 23:MZb6FE7TEQEqskLXroH4mUMThapeAk3zVibVP/H?= =?iso-8859-1?q?ymthO/wLAa3HO7c?= =?iso-8859-1?q?SU5ewi+XaBfqzRG8+VzbNFMa+M3b8GRPETkg85bA2/M8TKRffs87J4crTxMp?= =?iso-8859-1?q?JfRqwlJdWG62ZlyTvudqvyvhCjjtM/U6ZcSbK5OolWS8A3OWj7TAq3estBOy?= =?iso-8859-1?q?IJ/mRt8bgJRv3nAVOg0c8fGsuheAU6zw2qWnV5mvSeAyoNVwdOvGtcA+5rop?= =?iso-8859-1?q?Dbs0qQKnKmq5gwqBUcNuG82eGEO4G4BVlENgF+VU2tBYkTkuXyvf8F26hbOj?= =?iso-8859-1?q?o7bvODS8j2qkzp+b7p4x85F2Ag4Fz0CF8nWAFxc2A1ZSSmoq9/urTYhA+z6S?= =?iso-8859-1?q?KIBQQpnfmqMwueBaOUTjmBV+wH02m5LAxwiQjYVW6kJ9p/lBAzXWY6+3Ml46?= =?iso-8859-1?q?NObqDBcwSWkwiVenWSbdeBns2yJaj50oxtDtJ1muHuEhuDCKEbv4a8V0uQFJ?= =?iso-8859-1?q?Hh/VDjZ8xrytbNVFLwfYPI/jC3Z1yqeCoa4ls6BeRQT/yV6nBqK8IOOIKUec?= =?iso-8859-1?q?NR3o04TZvTAktQTYi+vWLk26hzUb7bDiVr0t4H4v16Ain4TyEDC4htBzv3xb?= =?iso-8859-1?q?LPCYYoxivDqDD+OHo8a0knsnM1biZTAdzxIyySbPJOxEyqPRqGEdjkfi1ixz?= =?iso-8859-1?q?+Qf8EH4hvcP8BAWUiEzeFSuyynb1tBHKeerteiskEnmoBNXP1OKZJg9rWIsS?= =?iso-8859-1?q?oK4M94ziW+BaXWNi9J/FyASROUdUrWycalVSbrJbejvSb7HiI20wxwQlN0lM?= =?iso-8859-1?q?sbckAmwEsbadEQ86NkTJax0hnPPsZoFWURSmTNt39KAcWlv24P/QQ8nJUVC/?= =?iso-8859-1?q?8507lMF2r4P1u/fbRrci+KlzNALQCTi5L7l9xb1pIRvWZveAO4e9WL0pgXdZ?= =?iso-8859-1?q?oFG6QnWt86L6JCQ/+cU0+XhC3PBlFBDt7rmaMewZP+ympsAlw/FrkOpzeT4Q?= =?iso-8859-1?q?SXSJStL43pahNtPqE45tFUpiwNso5/e0Z+BX6W9B69TIEV5p7l/XGsKt2xTl?= =?iso-8859-1?q?zDLctGGvB0i+YHcjEGuBfIP9jJwg5+Z1NTz1DmFbGrvplPCLG1nGHbwBPq7a?= =?iso-8859-1?q?XyRW2zJslw7TAQZZNLy5Ae6mxQvMyvRJCntsbTP3ytXC8OaFm9cTC/zQhE1Q?= =?iso-8859-1?q?6BAzJGBblE3s3X+lZs9T/f9cfN54kZCybQX8Fdnh/fNViCCJr/EV1NvvZv5v?= =?iso-8859-1?q?w1CiGEy6M+kHlBO5iVHQ/wLoQqiEcWHcFnzL7K+qEfW/NXtzjgVK+yHgGzF0?= =?iso-8859-1?q?iVhCG/sRD+01JKDp0c1DhYZR53/o4cHy2UufT8APlQhAEvthzDI8Xdt+rxc1?= =?iso-8859-1?q?SoLt5glv8=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09525C61DB x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(136003)(376002)(39860400002)(199004)(189003)(110136005)(256004)(11346002)(52116002)(446003)(76176011)(386003)(8936002)(99286004)(54906003)(1076003)(316002)(2616005)(14444005)(106356001)(305945005)(186003)(97736004)(105586002)(476003)(36756003)(26005)(486006)(53936002)(107886003)(66066001)(71200400001)(71190400001)(6506007)(81166006)(6436002)(81156014)(25786009)(8676002)(2201001)(478600001)(6512007)(4326008)(2501003)(14454004)(50226002)(2906002)(6116002)(3846002)(86362001)(68736007)(6486002)(7736002)(102836004)(72206003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR11MB1448; H:CY4PR11MB1256.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: TDEUE6BnMxVsHn1K80eItr+Xmr8KVl4LKJ3FA0Ndwaxrvh8m67XVayB1wy0G6vFOvRLjGtve+bDHSh/TPi7IazH3zujSMKF2V1Z69lfehoOycuLcCJhsr6V9f4KcQ2v/iB3HE/NeWDEXIZR81650PGKYV6hblcOyHN6Urd6BzxdRyCHCA6vFkRBNMSmp9fNrwTZV596BkRHj8VYLEJeGd7Np1xWfvCpk59WgEv9amvXkxE0lFK4V9nLeOAyjIqI4c6epVQGvuBDll4JRmww8eUX7ctUkGJJLuC0ZufGG8p9M9dyJCNT9Q9FHWkBkB0G1N3BD2uYnHG1oXHa2TN+1Gl87DWIgXJFmIzJ38BTGLEsLiqpSEHKIvF/4afx0x4bZCLhNoKVTEVHe445z9cxh1WnJlZsqS6YJpLaJXBCj6A0= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 109e64c2-a0bc-4c40-5310-08d695bb9ceb X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2019 16:10:32.7681 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1448 X-OriginatorOrg: microchip.com Cc: alsa-devel@alsa-project.org, Codrin.Ciubotariu@microchip.com, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 4/5] ASoC: codecs: ad193x: Add runtime support for DSP_A and I2S modes X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Codrin Ciubotariu The driver only supports DPS_A for DAC, which is configured at probe. This patch adds support for DSP_A and I2S modes by using the set_fmt() callback. A trivial break is also removed from a case's default branch. Signed-off-by: Codrin Ciubotariu --- sound/soc/codecs/ad193x.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index 315ec9775118..f8cf182518a3 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c @@ -188,23 +188,26 @@ static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai, { struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(codec_dai->component); unsigned int adc_serfmt = 0; + unsigned int dac_serfmt = 0; unsigned int adc_fmt = 0; unsigned int dac_fmt = 0; /* At present, the driver only support AUX ADC mode(SND_SOC_DAIFMT_I2S - * with TDM) and ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A) + * with TDM), ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A) and DAC I2S mode + * (SND_SOC_DAIFMT_I2S) */ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S: adc_serfmt |= AD193X_ADC_SERFMT_TDM; + dac_serfmt |= AD193X_DAC_SERFMT_STEREO; break; case SND_SOC_DAIFMT_DSP_A: adc_serfmt |= AD193X_ADC_SERFMT_AUX; + dac_serfmt |= AD193X_DAC_SERFMT_TDM; break; default: if (ad193x_has_adc(ad193x)) return -EINVAL; - break; } switch (fmt & SND_SOC_DAIFMT_INV_MASK) { @@ -261,6 +264,8 @@ static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai, regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL2, AD193X_ADC_FMT_MASK, adc_fmt); } + regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL0, + AD193X_DAC_SERFMT_MASK, dac_serfmt); regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL1, AD193X_DAC_FMT_MASK, dac_fmt); From patchwork Mon Feb 18 16:10:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 10818459 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 54594922 for ; Mon, 18 Feb 2019 16:49:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E4DB29CCD for ; Mon, 18 Feb 2019 16:49:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32C5529CE1; Mon, 18 Feb 2019 16:49:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91E9F29CDA for ; Mon, 18 Feb 2019 16:49:10 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 33C3D265537; Mon, 18 Feb 2019 17:10:50 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E77AE265534; Mon, 18 Feb 2019 17:10:46 +0100 (CET) Received: from esa1.microchip.iphmx.com (esa1.microchip.iphmx.com [68.232.147.91]) by alsa0.perex.cz (Postfix) with ESMTP id 7AC6126552A for ; Mon, 18 Feb 2019 17:10:44 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.58,385,1544511600"; d="scan'208";a="27906386" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Feb 2019 09:10:43 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.105) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 18 Feb 2019 09:10:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2/wBRKgxMNitjhuf2T+HLSlxvjyfOy2D8diFHrndBxw=; b=FZNYkEXAO+oWUIaRRuq3NIjW89T3icf+7y5uGcUsdZhR4XtFEVa4je4uqv90Rc0uSKPTvAxMrkdGwpGV5A6ATd6xabQrxxzCHRz+hv5OQsOdRdA7bqxGNp7n0LMUQR/uB2qExnmT8oNTxzMtBTLhfwgSouAEc2u/Z2BtL3TXk+4= Received: from CY4PR11MB1256.namprd11.prod.outlook.com (10.169.252.10) by CY4PR11MB1448.namprd11.prod.outlook.com (10.172.69.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Mon, 18 Feb 2019 16:10:36 +0000 Received: from CY4PR11MB1256.namprd11.prod.outlook.com ([fe80::d9cc:7741:4930:cda3]) by CY4PR11MB1256.namprd11.prod.outlook.com ([fe80::d9cc:7741:4930:cda3%7]) with mapi id 15.20.1622.018; Mon, 18 Feb 2019 16:10:36 +0000 From: To: , , Thread-Topic: [PATCH 5/5] ASoC: codecs: ad193x: Add support to disable on-chip PLL Thread-Index: AQHUx6R7m5808glWEUW45gyS4DZmHQ== Date: Mon, 18 Feb 2019 16:10:36 +0000 Message-ID: <20190218160954.13929-6-codrin.ciubotariu@microchip.com> References: <20190218160954.13929-1-codrin.ciubotariu@microchip.com> In-Reply-To: <20190218160954.13929-1-codrin.ciubotariu@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P123CA0020.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:a6::32) To CY4PR11MB1256.namprd11.prod.outlook.com (2603:10b6:903:25::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Codrin.Ciubotariu@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ecbad4ae-85e7-4217-2ebe-08d695bb9e21 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:CY4PR11MB1448; x-ms-traffictypediagnostic: CY4PR11MB1448: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; CY4PR11MB1448; 23:9okqPwV6Yi1Xsr9vYK0tMbvHSRVudMJIi0fnJv2?= =?iso-8859-1?q?rqlwyqfs/g8nSgS?= =?iso-8859-1?q?2c0SnxZ5ygGCL9b61Kk9uJoAf3b5AJtYMTgY59n0N6kobjitap3u6z240vK3?= =?iso-8859-1?q?Q0GNFq7EplMVbEDbdtKjbo/YL+VwqacPwFUOSwpt5MHCPnJnb2OIBL8/1p6I?= =?iso-8859-1?q?Rempb9vbRH8fFZB1rHCdYRyf8x2ffTU+YTYNEP5QyRXR6xq3uV2EnEjFP8kd?= =?iso-8859-1?q?7qpH908pAh8baWvMLKNPb7728y9qZHRR/KjYfaXsnu4unLstZpHnUo6iWhZX?= =?iso-8859-1?q?HkELZ0fu3EjCyzQdmm397NQPjZji8COAjm7aww3n5SfbeVPn26SigENUGdKI?= =?iso-8859-1?q?JEUb0FC2loYRAs5tli+B53oyh8VuTpDHyUHwo6Wqh1VZSgxktXwuimre9xPJ?= =?iso-8859-1?q?5GIiVB5H3peAK8waELPqk2pIU83gEdp1wSoaH1qYOmgLljpr9WsyYkM68JfY?= =?iso-8859-1?q?vZz51o/ntYLwpzxQlWJItzlSAhrvLBS//ipp530LntqxqnYChoBzkLkP/+bO?= =?iso-8859-1?q?c0FCCccPP1Bbct3Ka/6xEsL9SUT7XNvguKxxvCJbav8PyaLdsdtk8FBlI7rF?= =?iso-8859-1?q?v7UvFuRaOILVGrITq6g0Vn/MKmJ2u1tyo6Nm5hibVyY48kN8XJg2A1fOxB9P?= =?iso-8859-1?q?CzLcrpmLyIwdWmtRe/7WjZ3ItM91lTvCJ2eSm8oEjFXAUxvNL0v6L3ll80d9?= =?iso-8859-1?q?gkOyVtT36derunuZdc5RsDmlpkzBjdhrl4/xnhkOi5XijPekJ/HZIk6aZtvy?= =?iso-8859-1?q?VUApBKEg7UJmAvHj3KfsDrJebTZOXrasKocUR3LHLaONRwmDQM5UeUD6IcBk?= =?iso-8859-1?q?Uz5ZfHDMUN/G59TJTF4UmW4/ekUJd0K/hiBs5lj0dcSWh11EYV0OYtf+tyal?= =?iso-8859-1?q?YnJknC8rhgopAFJhguYjCyVfm2N4eLybAUM9vJY3noU3vYHyGCWLtMp5kN7R?= =?iso-8859-1?q?PHkVst15M3i87lEeq+M3U7H0csLzXH2G8WY267r/N9U+aCbwPPciIrz8+NTL?= =?iso-8859-1?q?oAncEUd7JibX2o03g17ua3zLAjypAReHKf0AB2XB1kaswjCHK73xK3NqMERD?= =?iso-8859-1?q?qL98rNmReFR4ChsFieKUxiagnpgVAFSKyoD4pbt5Hq8rsFRtWZRc7pohjxFp?= =?iso-8859-1?q?24/vTtIbo8F3PD+wSokmchsFL4x+xn0cA5bp1sNmSgIwJjzGhVE/uFDWbKSU?= =?iso-8859-1?q?RTKMbFFaMt8aX60DUG8S2QM6DTy5+z84MZKnCK3yhL/vL1AL/+RG421QTsWR?= =?iso-8859-1?q?oE8B6EJipsT1ryfMzrN9DqF83TZGyPshGN5WUx543zuF8kIOY3b7IZb0ZuNd?= =?iso-8859-1?q?882uWPypK8Ifje+++6pHxy2jawyDfE?= x-microsoft-antispam-prvs: x-forefront-prvs: 09525C61DB x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(136003)(376002)(39860400002)(199004)(189003)(110136005)(256004)(11346002)(52116002)(446003)(76176011)(386003)(8936002)(99286004)(54906003)(1076003)(316002)(2616005)(14444005)(106356001)(305945005)(186003)(97736004)(105586002)(476003)(36756003)(26005)(486006)(53936002)(107886003)(66066001)(71200400001)(71190400001)(6506007)(81166006)(6436002)(81156014)(25786009)(8676002)(2201001)(478600001)(6512007)(4326008)(2501003)(14454004)(50226002)(2906002)(6116002)(3846002)(86362001)(68736007)(6486002)(7736002)(102836004)(72206003)(5660300002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR11MB1448; H:CY4PR11MB1256.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: HIdHRw7e5vxcwsxgEObO2GThtq8xMUL6VEcYpbHpLtHQSAFQ0FKVJH/EwYmsk5JqE0B0gaISAaApY74pDARLbKqUIaRJjxT9/GjvFcHnGMsq/BCJT8ix1DfDcz9uV6+BBXP0MjiQRYDYQXjbR0IJgShh2H/PFwgXqjhWKdhC6gil7GV9lCr7GGilRpGrZrAE8aNcxyzgSQu5nHIOeDCB10GTgUwxqsu1553VLM+Am6OBoMv5w5oxp0v00Z4k5Hq1HBtdhyxX0weK8CjWOkfaUdYiziuz+LJ1rw6EmNGuLq3TPkYSTBqoFfC3m3fSdsVTKk5QgcpMWTOe7Hqj2XRHVHZ5PsXyrYacC1NNBOz5fk3OjfgurjeOU8azZF3YV/J+ccDqqI/NbiKwalw69yGK3sFwCkHLQpI3uCRKE44A5x8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ecbad4ae-85e7-4217-2ebe-08d695bb9e21 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2019 16:10:35.0010 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1448 X-OriginatorOrg: microchip.com Cc: alsa-devel@alsa-project.org, Codrin.Ciubotariu@microchip.com, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 5/5] ASoC: codecs: ad193x: Add support to disable on-chip PLL X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Codrin Ciubotariu The on-chip PLL can be disabled if on the MCLKI pin we have an external clock at 512 x fs. This clock can be used as direct internal clock for ADCs or DACs. To support this, we add an extra clock id that can be configured using the set_sysclk() callback. Signed-off-by: Codrin Ciubotariu --- sound/soc/codecs/ad193x.c | 26 +++++++++++++++++++++++++- sound/soc/codecs/ad193x.h | 8 ++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index f8cf182518a3..96d7cb2e4a56 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c @@ -100,6 +100,15 @@ static const struct snd_soc_dapm_widget ad193x_adc_widgets[] = { SND_SOC_DAPM_INPUT("ADC2IN"), }; +static int ad193x_check_pll(struct snd_soc_dapm_widget *source, + struct snd_soc_dapm_widget *sink) +{ + struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); + struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(component); + + return !!ad193x->sysclk; +} + static const struct snd_soc_dapm_route audio_paths[] = { { "DAC", NULL, "SYSCLK" }, { "DAC Output", NULL, "DAC" }, @@ -108,7 +117,7 @@ static const struct snd_soc_dapm_route audio_paths[] = { { "DAC2OUT", NULL, "DAC Output" }, { "DAC3OUT", NULL, "DAC Output" }, { "DAC4OUT", NULL, "DAC Output" }, - { "SYSCLK", NULL, "PLL_PWR" }, + { "SYSCLK", NULL, "PLL_PWR", &ad193x_check_pll }, }; static const struct snd_soc_dapm_route ad193x_adc_audio_paths[] = { @@ -276,7 +285,22 @@ static int ad193x_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_component *component = codec_dai->component; + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(component); + + if (clk_id == AD193X_SYSCLK_MCLK) { + /* MCLK must be 512 x fs */ + if (dir == SND_SOC_CLOCK_OUT || freq != 24576000) + return -EINVAL; + + regmap_update_bits(ad193x->regmap, AD193X_PLL_CLK_CTRL1, + AD193X_PLL_SRC_MASK, + AD193X_PLL_DAC_SRC_MCLK | + AD193X_PLL_CLK_SRC_MCLK); + + snd_soc_dapm_sync(dapm); + return 0; + } switch (freq) { case 12288000: case 18432000: diff --git a/sound/soc/codecs/ad193x.h b/sound/soc/codecs/ad193x.h index 8b1e65f928d2..27d6afbd7dfb 100644 --- a/sound/soc/codecs/ad193x.h +++ b/sound/soc/codecs/ad193x.h @@ -31,6 +31,11 @@ int ad193x_probe(struct device *dev, struct regmap *regmap, #define AD193X_PLL_INPUT_512 (2 << 1) #define AD193X_PLL_INPUT_768 (3 << 1) #define AD193X_PLL_CLK_CTRL1 0x01 +#define AD193X_PLL_SRC_MASK 0x03 +#define AD193X_PLL_DAC_SRC_PLL 0 +#define AD193X_PLL_DAC_SRC_MCLK 1 +#define AD193X_PLL_CLK_SRC_PLL (0 << 1) +#define AD193X_PLL_CLK_SRC_MCLK (1 << 1) #define AD193X_DAC_CTRL0 0x02 #define AD193X_DAC_POWERDOWN 0x01 #define AD193X_DAC_SERFMT_MASK 0xC0 @@ -96,4 +101,7 @@ int ad193x_probe(struct device *dev, struct regmap *regmap, #define AD193X_NUM_REGS 17 +#define AD193X_SYSCLK_PLL 0 +#define AD193X_SYSCLK_MCLK 1 + #endif