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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1955BC6FD1A for ; Mon, 6 Mar 2023 22:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbjCFW5M (ORCPT ); Mon, 6 Mar 2023 17:57:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjCFW5K (ORCPT ); Mon, 6 Mar 2023 17:57:10 -0500 Received: from sonic303-21.consmr.mail.ir2.yahoo.com (sonic303-21.consmr.mail.ir2.yahoo.com [77.238.178.202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FFAF55066 for ; Mon, 6 Mar 2023 14:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1678143426; bh=XSBz/sbloJzyHXx4Q7tnCEBikxS3m0uN7IkqFail+lQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=I0YzCmHtjg/Fi6ou1e3gpzia0ZaLoZ/CBSL66f4is1wpgTGE1YjtTf5pENkBb1g5Kyp0T5a1S+SXUD9EvBn+lK1Zvxo1VTSQTXWb5Tskwu3rhcKIuo4LVO3N3ez6JzSHB8HB+vYl3bBvSFfxiZJ+4wRGIX1X7h9UM0r9TzwhpM22yo//5SbJ2JxVkb8xwXBygHE/wdvg3p3rHENQsA5NiJrQVcd8fU3rGmlDN+NSQzAZahYR8BSlCy6Q7InvrPHuApEIpAXJm57c8goavoludt8l24qe6wxJdoEsGwhFEPXxeYk8p4RruY22sCVVM+i3tkLK+n4YQKwqqzx8RrxRjQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/rela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t38y8LCG5gzeVpBMX8TithaB8jqHeYvKSSqMWtnNVbskfO4vGPrAJp U6F4J8skuqaKH6bMJ07fmcY07h9kq8DrxX6wmy5pZ1TVDJGTt8Cl.Pxi.lrBhGRqrTUjoDMTWxCp kBrIL9UoONZL8I8ctZGkCCC_HJQM1y.5BFMfl90gtkkTVZxeQbMy4MER.thVuTaMvg4skQUT6c_2 N7c4bN0jHkbflPy6GX.gr4jzDK58xNHDO55szDNKcV1Ewz0L5Wu8KfbzwU_lUqAQx0Kti4za.34J DQ2cu5CSE8BfFD51RSqdLt8kvV1mZ1.NN.09FWTlgnI33VoKFsyLDOFmeEF8d2W1Z1pPDJKim_29 7VX9scm7.39vW8_AOSFGa3bjS06cg7ABRCGh2bKveMP3Oc6GhxjvZ9Gr11goj0Tifdv6tdQGVkJb E9EIzq8Fx4qaPDjIPWq5nPByiG9rjwzEVxg5E1mwol1GX3wJ0EXushjUzmkzEhDu5UYC3uJU3VsN nvlBrcVAM1E9aBeMEeyYGR.DJag0s0I3sbfF9SojCux18pjP6L9o.cIOxQ2mrAq6d6qDUDbeOOKC i884e64ffPEFjAIm0LgOTVyKx2Qvjen1KlbmXW1kafhzouqU5oyZtY9DOONTkTAN20sbxlVbPVgI uM0uFLzKIYi9Kiu8SU8W2dlrNPsR9WQ-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Mon, 6 Mar 2023 22:57:06 +0000 Received: by hermes--production-ir2-5b7d458747-xwgkr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID fa2112826ed9439f5fbb2bca96b124cf; Mon, 06 Mar 2023 22:57:06 +0000 (UTC) Message-ID: <66db70ea-9605-58c3-6f2c-2195128193ea@rocketmail.com> Date: Mon, 6 Mar 2023 23:57:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH 02/10] mfd: rt5033: Fix chip revision readout To: Lee Jones Cc: Sebastian Reichel , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Beomho Seo , Chanwoo Choi , Stephan Gerhold , Raymond Hackley , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht References: <20230305104704.GG2574592@google.com> <96c54beb-228c-d606-5b9c-613ee2bc5e70@rocketmail.com> <20230306091843.GE9667@google.com> Content-Language: en-US From: Jakob Hauser In-Reply-To: <20230306091843.GE9667@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.21284 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lee, On 06.03.23 10:18, Lee Jones wrote: > On Sun, 05 Mar 2023, Jakob Hauser wrote: > >> Hi Lee, >> >> On 05.03.23 11:47, Lee Jones wrote: >>> On Tue, 28 Feb 2023, Jakob Hauser wrote: >>> >>>> After reading the data from the DEVICE_ID register, mask 0x0f needs to be >>>> applied to extract the revision of the chip [1]. >>>> >>>> The other part of the DEVICE_ID register, mask 0xf0, is a vendor identification >>>> code. That's how it is set up at similar products of Richtek, e.g. RT9455 [2] >>>> page 21 top. >>>> >>>> [1] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/drivers/mfd/rt5033_core.c#L484 >>>> [2] https://www.richtek.com/assets/product_file/RT9455/DS9455-00.pdf >>>> >>>> Signed-off-by: Jakob Hauser >>>> --- >>>> drivers/mfd/rt5033.c | 8 +++++--- >>>> include/linux/mfd/rt5033-private.h | 4 ++++ >>>> 2 files changed, 9 insertions(+), 3 deletions(-) >>>> >>>> diff --git a/drivers/mfd/rt5033.c b/drivers/mfd/rt5033.c >>>> index 8029d444b794..d32467174cb5 100644 >>>> --- a/drivers/mfd/rt5033.c >>>> +++ b/drivers/mfd/rt5033.c >>>> @@ -55,7 +55,8 @@ static const struct regmap_config rt5033_regmap_config = { >>>> static int rt5033_i2c_probe(struct i2c_client *i2c) >>>> { >>>> struct rt5033_dev *rt5033; >>>> - unsigned int dev_id; >>>> + unsigned int data; >>> >>> In terms of nomenclature, this is a regression. >>> >>> 'data' is a terrible variable name. Why not keep it as-is? >> >> While not having a datasheet for RT5033 available, in similar products like >> RT9455 the register is called "Device ID", the first part of that is >> "VENDOR_ID" and the second part "CHIP_REV", [1] page 23 top. Or in RT5036 >> preliminary data sheet the register is called "ID", the first part >> "VENDOR_ID" and the second part "CHIP_REV_ID", [2] page 27 top. >> >> I wanted to avoid confusion between "dev_id" and "chip_rev". Therefore in >> the patch it's written as getting some "data" from the register and extract >> "chip_rev" from that data. >> >> I could change it to "reg_data"? Or something in that direction? I still >> think that getting "chip_rev" out of "dev_id" would be confusing. > > You're reading from a register called RT5033_REG_DEVICE_ID. I don't see > any reason why the variable you read into can't reflect that. OK, I'll use "dev_id" and "chip_rev" for the variable names. ... Kind regards, Jakob