Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3702798rdh; Tue, 28 Nov 2023 01:09:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLVmZ9yhSvpM1UP/PMidrfRqD9XkBbRlM63Yrel+xDDt2b7GGxMwpjC7AMZgyorHTylq8O X-Received: by 2002:a05:6871:438b:b0:1e9:bba3:4902 with SMTP id lv11-20020a056871438b00b001e9bba34902mr17652331oab.37.1701162586828; Tue, 28 Nov 2023 01:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701162586; cv=none; d=google.com; s=arc-20160816; b=XEPrmVvPfDFRMBE8bQgfNueM3K2rhqe4Xie0H4pevuEZZ88/rlpeOhCD4IhwY43/s3 YyZ6F5Nuv7l9SQKPyiDqeNDlOB57UmDMYHnIksMBmVHc6VjqlxiRHEFuo3uVDLZndnmp Vh/0H7vfq0AC/+gNQyiduMQ1mBzSKjd75pP7IevyKTAg0JViTjVMmHSKSxkr2pm98lCb ZN6Yo4+Tlkz94uWVwm3HDFKNe+9huDfZCqt3yLCSuxT5noZCeY5Elv2JtOFFCgqtBdav ZeqO969oXLxZFBa0VDn+b2+Q9uWMZnWrL6QvitdFDnCdbTZGFDFSZGzlWJVQIAdod+e+ IH0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:autocrypt:references:cc:to:content-language:subject :reply-to:from:user-agent:mime-version:date:message-id :dkim-signature; bh=ruBsZSrQwJWh8DMQKbh5iJ2P0cf6QJW5qv9vaOwvUVQ=; fh=yz7Gm1J2IzlTAWZntXYSVTgxMMICM2/Oec+Fqby/pCQ=; b=bA+3wxP0eS3gR2OHuzUMRKuWSK9XWteU7DmAhoXsbcCKHImdyv/ssYtr9lMbzj1VLG tNaJZj6z+TftOgirS+G0mI4uDQdim2xksZhk//5zfQuY+PUeg52t4CSeZR+YFSxqxByO KbTzB2sZslkmixmN6q2Oyj6acEdb3SLNlDVzuuGZkcawtybgOu3Ve3zs2nLahjEypWmC +Pru+jHaabQ2o8CniT+VYUmKVud3X2ny7xOOr1nAuQy2PL/iXjc8UzO6a81Ukhxv1QSf aQcbhxmeGKgw7TdhxS+wxgUCytdrF5ote+/rW5EX1HZPMPiJepn6iq+nhBq4Bc4Vn7LW M9Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=StSWHPxl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 195-20020a6301cc000000b005c21fa725casi10868799pgb.596.2023.11.28.01.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 01:09:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=StSWHPxl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 365F08057E21; Tue, 28 Nov 2023 01:09:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234740AbjK1JJ2 (ORCPT + 99 others); Tue, 28 Nov 2023 04:09:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231488AbjK1JJ1 (ORCPT ); Tue, 28 Nov 2023 04:09:27 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21B6299 for ; Tue, 28 Nov 2023 01:09:33 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-332ed1bd4cbso2239809f8f.2 for ; Tue, 28 Nov 2023 01:09:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701162571; x=1701767371; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:autocrypt :references:cc:to:content-language:subject:reply-to:from:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=ruBsZSrQwJWh8DMQKbh5iJ2P0cf6QJW5qv9vaOwvUVQ=; b=StSWHPxlD8xl1n8zHQSoJ05SBS2PVfTXqBTQiCoHMEp6QVWWjLwmt4uGDRrXbtypv3 cpUS3aspuWjOqmapMSqpqISj5lExge3Cvhs11caNLgZTSjfEiTxirSKxgmynFBHM/q3b EU2VXWWxkLa5kRt50v0lfC9mnRil/PFjR9jzl7MORTI12yxrVw/LiD9oS116UTNtWuke KZUru+13JFaXvChyc992I+kI9e+FWwl0v9isURkyU5fuTCELDgnagdNZo/5fvh9wqg3g nh7lUD1wl0Un5gwQuXTSduDkULhn03IGiGx3DbWPdGRRbJQuCs1PI2RNRV3FfTHzeOPo d0NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701162571; x=1701767371; h=content-transfer-encoding:in-reply-to:organization:autocrypt :references:cc:to:content-language:subject:reply-to:from:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=ruBsZSrQwJWh8DMQKbh5iJ2P0cf6QJW5qv9vaOwvUVQ=; b=X39FOq+p/GkVusB7X/EPRyIdn3fqzqpqG1cSWbj8Hi0ZARf/T7VQ3FBaXscgBOMe/G 2hOdLzo5zZAn2rrMzvIiMuS0BMarBQPldf954RWDp+LYCzi+tGmLYX/R/pINFBmyukJi POWV5IQ5tXKshENBMjAohL1uqyO65/TRBCEUr101SmNTLxiH8ctbEJzosy3cBNpl8xGr UF/EcfmKr1ZsxAbbIDsVsFUT8Ie6RXtTwioB2P9xZtEEA7YFZ4tv19+nzAUUpRzyKbb+ 3Yc85iRCqRKDMa0G4E7ZlLo3aopSl3RnImajwIOF57disRziZw0H1oTg0FNDINGksMOf Qh1A== X-Gm-Message-State: AOJu0YzwsbcOaxiA+rObNIJX/CwVcQIcjPsOUm5J3Q7Wwbc1RTyuaXAA pmck2sz0Xss5QyUFNYLp/jdAVSwzk+EjS9miI3nczoiW X-Received: by 2002:adf:e282:0:b0:333:829:e55c with SMTP id v2-20020adfe282000000b003330829e55cmr2436057wri.10.1701162571548; Tue, 28 Nov 2023 01:09:31 -0800 (PST) Received: from ?IPV6:2a01:e0a:982:cbb0:eada:f40e:7ab3:2afe? ([2a01:e0a:982:cbb0:eada:f40e:7ab3:2afe]) by smtp.gmail.com with ESMTPSA id e2-20020a5d4e82000000b0032d893d8dc8sm14369433wru.2.2023.11.28.01.09.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Nov 2023 01:09:31 -0800 (PST) Message-ID: Date: Tue, 28 Nov 2023 10:09:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Neil Armstrong Reply-To: neil.armstrong@linaro.org Subject: Re: [PATCH 4/5] ASoC: codecs: Add WCD939x Soundwire slave driver Content-Language: en-US, fr To: Mark Brown Cc: Srinivas Kandagatla , Banajit Goswami , Andy Gross , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231123-topic-sm8650-upstream-wcd939x-codec-v1-0-21d4ad9276de@linaro.org> <20231123-topic-sm8650-upstream-wcd939x-codec-v1-4-21d4ad9276de@linaro.org> Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAHNKk5laWwgQXJtc3Ryb25nIDxuZWlsLmFybXN0cm9uZ0BsaW5hcm8ub3JnPsLAkQQTAQoA OwIbIwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgBYhBInsPQWERiF0UPIoSBaat7Gkz/iuBQJk Q5wSAhkBAAoJEBaat7Gkz/iuyhMIANiD94qDtUTJRfEW6GwXmtKWwl/mvqQtaTtZID2dos04 YqBbshiJbejgVJjy+HODcNUIKBB3PSLaln4ltdsV73SBcwUNdzebfKspAQunCM22Mn6FBIxQ GizsMLcP/0FX4en9NaKGfK6ZdKK6kN1GR9YffMJd2P08EO8mHowmSRe/ExAODhAs9W7XXExw UNCY4pVJyRPpEhv373vvff60bHxc1k/FF9WaPscMt7hlkbFLUs85kHtQAmr8pV5Hy9ezsSRa GzJmiVclkPc2BY592IGBXRDQ38urXeM4nfhhvqA50b/nAEXc6FzqgXqDkEIwR66/Gbp0t3+r yQzpKRyQif3OwE0ETVkGzwEIALyKDN/OGURaHBVzwjgYq+ZtifvekdrSNl8TIDH8g1xicBYp QTbPn6bbSZbdvfeQPNCcD4/EhXZuhQXMcoJsQQQnO4vwVULmPGgtGf8PVc7dxKOeta+qUh6+ SRh3vIcAUFHDT3f/Zdspz+e2E0hPV2hiSvICLk11qO6cyJE13zeNFoeY3ggrKY+IzbFomIZY 4yG6xI99NIPEVE9lNBXBKIlewIyVlkOaYvJWSV+p5gdJXOvScNN1epm5YHmf9aE2ZjnqZGoM Mtsyw18YoX9BqMFInxqYQQ3j/HpVgTSvmo5ea5qQDDUaCsaTf8UeDcwYOtgI8iL4oHcsGtUX oUk33HEAEQEAAcLAXwQYAQIACQUCTVkGzwIbDAAKCRAWmrexpM/4rrXiB/sGbkQ6itMrAIfn M7IbRuiSZS1unlySUVYu3SD6YBYnNi3G5EpbwfBNuT3H8//rVvtOFK4OD8cRYkxXRQmTvqa3 3eDIHu/zr1HMKErm+2SD6PO9umRef8V82o2oaCLvf4WeIssFjwB0b6a12opuRP7yo3E3gTCS KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro Developer Services In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 01:09:44 -0800 (PST) Hi, On 23/11/2023 18:43, Mark Brown wrote: > On Thu, Nov 23, 2023 at 03:49:14PM +0100, Neil Armstrong wrote: >> Add Soundwire Slave driver for the WCD9390/WCD9395 Audio Codec. > >> The WCD9390/WCD9395 Soundwire Slaves will be used by the > > Please avoid using outdated terminology, "device" is probably a good > alternative here. There are some usages in APIs that need to be updated > but still, good to avoid where possible. Sure, I simply kept the current Soundwire kernel terminologies, I'll change it to Device. > >> +static struct wcd939x_sdw_ch_info wcd939x_sdw_tx_ch_info[] = { >> + WCD_SDW_CH(WCD939X_ADC1, WCD939X_ADC_1_4_PORT, BIT(0)), >> + WCD_SDW_CH(WCD939X_ADC2, WCD939X_ADC_1_4_PORT, BIT(1)), >> + WCD_SDW_CH(WCD939X_ADC3, WCD939X_ADC_1_4_PORT, BIT(2)), >> + WCD_SDW_CH(WCD939X_ADC4, WCD939X_ADC_1_4_PORT, BIT(3)), >> + // TOFIX support ADC3/4 & DMIC0/1 on port 2 >> + //WCD_SDW_CH(WCD939X_ADC3, WCD939X_ADC_DMIC_1_2_PORT, BIT(0)), >> + //WCD_SDW_CH(WCD939X_ADC4, WCD939X_ADC_DMIC_1_2_PORT, BIT(1)), >> + //WCD_SDW_CH(WCD939X_DMIC0, WCD939X_ADC_DMIC_1_2_PORT, BIT(2)), >> + //WCD_SDW_CH(WCD939X_DMIC1, WCD939X_ADC_DMIC_1_2_PORT, BIT(3)), > > Why are these commented out? Future feature support, will remove and add those on my internal TODO list... > >> +static int wcd9390_interrupt_callback(struct sdw_slave *slave, >> + struct sdw_slave_intr_status *status) >> +{ >> + struct wcd939x_sdw_priv *wcd = dev_get_drvdata(&slave->dev); >> + struct irq_domain *slave_irq = wcd->slave_irq; >> + u32 sts1, sts2, sts3; >> + >> + do { >> + handle_nested_irq(irq_find_mapping(slave_irq, 0)); >> + regmap_read(wcd->regmap, WCD939X_DIGITAL_INTR_STATUS_0, &sts1); >> + regmap_read(wcd->regmap, WCD939X_DIGITAL_INTR_STATUS_1, &sts2); >> + regmap_read(wcd->regmap, WCD939X_DIGITAL_INTR_STATUS_2, &sts3); >> + >> + } while (sts1 || sts2 || sts3); >> + >> + return IRQ_HANDLED; >> +} > > We do this in the other Qualcomm drivers but it doesn't seem ideal to > just ignore the interrupts. It seems we simply ignore IRQs that are not mapped in the regmap_irq, what would be the ideal way to handle this ? > >> +static int wcd939x_sdw_component_bind(struct device *dev, struct device *master, >> + void *data) >> +{ >> + return 0; >> +} >> + >> +static void wcd939x_sdw_component_unbind(struct device *dev, >> + struct device *master, void *data) >> +{ >> +} >> + >> +static const struct component_ops wcd939x_sdw_component_ops = { >> + .bind = wcd939x_sdw_component_bind, >> + .unbind = wcd939x_sdw_component_unbind, >> +}; > > Do these need to be provided if they can legitimately be empty? AFAIK yes, component code will crash if those are not defined. I'll add a comment explaining whey they are no-op. Thanks, Neil