Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4651869rdh; Wed, 29 Nov 2023 07:12:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzfm+8e/CipfbkmlC4JljecwB5P+wTzLMubLpIDHNmIv6blyQKic0q7WGF9sBwF6kDqMT7 X-Received: by 2002:a05:6a00:3909:b0:6be:130a:22a0 with SMTP id fh9-20020a056a00390900b006be130a22a0mr20604450pfb.14.1701270757238; Wed, 29 Nov 2023 07:12:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701270757; cv=none; d=google.com; s=arc-20160816; b=F3MqvVMk+ukRvMuwuqZpVJBxljLt6r/ln+GQZHh61wuM/vyiYuObfRyq86UBlwB/Gq ut/LIg4WRxZaivc3cM//1QcLCwlYKoWPaesIOabA+Btne7qD5/2CZJlCwb7JPzZtBDkW 6fUi6HdER/gLqx74jYVFZxhP15KHflThM7lmSEhYFVzObfm1iS2UsxWNN/gYzomrlQhw h78R1F2fHyuw06+0PeUmyEGNP37FIC7ie3ggM2m4bNjvYAk+MXK2F7bfJlzYDPFu6Cc1 /bVOAd8BJPXQV4GIYQCJUxMbD07MT/fFYIqGYvnv3Vfx2Pa30SQuUiHuGsG7lLq44nlE w53w== 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=9Hdd64HNUK0tSK3Da+oWNy4zZpaQIUo/ssbLKmavYcU=; fh=pPx/cTERIdK6h5EQBbuhPqy/r26j/nKEpu8HseEFkQk=; b=eECUg8v4UOnUVkwRqEOUIHN354DK3P3PdAh/D7+QjmxYbzd6wjdnJkbwVWuNiLTlsc MF7Xme7OCTyZB+UCv0GeNDU2d5bp+tdr1RVQp1hIA/ax7Cpt+ANPtTV0XLdC5OZU3feT l9OD5k3OB+aD3Hae0NhO0e8qnn0ls/BVJmqeZ5Ys49eT30Ko+lMeepRcosimNnsNDmtp vZ1RfsGQHUZqE5sJAn5CqyNdgoVLMOOq7tot54QdgF4VakBG7QqVfo9t9Vjt0ZRxIaLH R/QqDmJ1bg0wkkTZcA+zROOann62hL5RTVQOrE4rxyDcF5kbht/yiaQGuufM4afG7gnO wQ7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wOCTXhZm; 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 fc4-20020a056a002e0400b006c1222c5eaasi14946416pfb.175.2023.11.29.07.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 07:12:37 -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=wOCTXhZm; 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 6E87480401F7; Wed, 29 Nov 2023 07:12:34 -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 S234567AbjK2PMS (ORCPT + 99 others); Wed, 29 Nov 2023 10:12:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231215AbjK2PMQ (ORCPT ); Wed, 29 Nov 2023 10:12:16 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25989D65 for ; Wed, 29 Nov 2023 07:12:22 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40b54261524so5627145e9.3 for ; Wed, 29 Nov 2023 07:12:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701270740; x=1701875540; 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=9Hdd64HNUK0tSK3Da+oWNy4zZpaQIUo/ssbLKmavYcU=; b=wOCTXhZmv+Wgg/kv0IJ87WkSTqjpyt9/xcvDfmCtM5kCEvMvgo+j+noueUdhMH98zO QKyavS+gpxJfyMeOAS/+YszBE0yzY0/vDbGDoyiw2p4wB1R1h+bKxykiwIjrzTpOA31I k71UaOXdLYVOOxIv66zY4tnnh4ZMqiDEHwZOnqeHhKR39BgXSdrmb40c/dme2eRwA91t Mk3rEB+p1iDLWzIrYUYXWe8fUKr/DGpP2F+iqr31PFBfL91EwhdkwzF/PdDv60ZpgibK r8qwyBDhr8JPFfwpK5NAL07Wz7VN738yswNraqj9WKxWNbPVJG30WXZRbdyG4cQXmy+J C53g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701270740; x=1701875540; 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=9Hdd64HNUK0tSK3Da+oWNy4zZpaQIUo/ssbLKmavYcU=; b=UablLfUItRbb10NUnJVdESoiP7p0IR4FkI7OOCrAecFzVrE2AlRcJQc2Ih1Cq2FmtP GkepVHYx95wLbHBWYph9RAw7ZgDEzUWxlmd8MbLA0qlL1EGO/13WN7nX3ipz+azT+IBs M792v/FdRBXTLI6li6f9AdD5Z1LCfHTwFLAOJQwqqVn4sk5DAlyd+Mis3qOfB2xAYHu+ sFXJlxFbv9vs6kGKGQKuahqbb5I9Nud5Igk1VfWX6IjY12BNzISH91EQr2TJfSWaweWd VX38PMrZFZkIWoBYwfgb5BNs9ZDIe5ACZiF8oN7ObOQZ+VhX7NdPzEJ2qLDWL0ou+8UN Y6Fg== X-Gm-Message-State: AOJu0YxRGxol94Ry10vlN7HDbs7pLcekRauPhsEjDjJaz9fHz+9cRxam wNAhMMK8SSvnPZGWl8WgzEMW2Q== X-Received: by 2002:a05:600c:4f42:b0:40a:28b1:70f8 with SMTP id m2-20020a05600c4f4200b0040a28b170f8mr14698978wmq.21.1701270740436; Wed, 29 Nov 2023 07:12:20 -0800 (PST) Received: from ?IPV6:2a01:e0a:982:cbb0:31d3:eea3:8f97:6a2c? ([2a01:e0a:982:cbb0:31d3:eea3:8f97:6a2c]) by smtp.gmail.com with ESMTPSA id j11-20020a05600c190b00b0040b47c69d08sm2531225wmq.18.2023.11.29.07.12.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Nov 2023 07:12:20 -0800 (PST) Message-ID: <0140f49d-c463-4011-8159-f4e56466e6bd@linaro.org> Date: Wed, 29 Nov 2023 16:12:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: neil.armstrong@linaro.org Reply-To: neil.armstrong@linaro.org Subject: Re: [PATCH 5/5] ASoC: codecs: Add WCD939x Codec driver Content-Language: en-US, fr To: Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Andy Gross , Bjorn Andersson , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai Cc: 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-5-21d4ad9276de@linaro.org> <42a6f6e0-2846-4cdc-8702-493fadbafb98@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: 8bit 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]); Wed, 29 Nov 2023 07:12:34 -0800 (PST) On 29/11/2023 14:46, Konrad Dybcio wrote: > On 28.11.2023 16:01, Neil Armstrong wrote: >> On 25/11/2023 13:07, Konrad Dybcio wrote: >> >> >> >>>> + >>>> +static int wcd939x_io_init(struct snd_soc_component *component) >>>> +{ >>>> +    snd_soc_component_write_field(component, WCD939X_ANA_BIAS, >>>> +                      WCD939X_BIAS_ANALOG_BIAS_EN, 1); >>> All of these values are BIT()s or 2-4 ORed BIT()s, can you check what they >>> mean? >>> >>> Same for almost all other snd_soc_component_ write/modify functions >> >> It uses snd_soc_component_write_field() with is the same as >> regmap_write_bits(REGISTER, REGISTER_MASK, >>                   FIELD_PREP(REGISTER_MASK, value); >> >> So the 1 mean write in enable mask in this case, and mask is single bit, >> read it exactly like if it was using FIELD_PREP(), but even for BITs. >> >> I did check every single snd_soc_component_write_field() so far to check >> it matches. >> >> Or it's another question ? > What I wanted to ask is whether it's possible to #define these magic > values within these fields OK, so most of writes are to boolean enable bits, I can use true/false instead of 0 & 1 for those, would it be more readable ? For the rest, those a integer values to a field, those are not bitmasks and I do not have the definition of the values. I did a full cleanup and tried to define as much as possible, there were still lot of places where not defined bitmasks we used, but there's still some integer values, but I think it's acceptable. Neil > > Konrad