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+vVC4pl3M2iM9CYj50HKv76DuukWa8wPDlWaU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XfRf9kEQPBMYnUCBOA9OsR7Wjjv/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,