From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD77AC48BCD for ; Wed, 9 Jun 2021 10:25:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A04A0611AE for ; Wed, 9 Jun 2021 10:25:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A04A0611AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HTuwK/Vy1KJWhJP57wOC58MFjKHHxraQf774f/d9+gw=; b=t5duRRUGmyWLvG uDFYw+jN97bRjRPnoe8nebVLiyqh+yjH1XQSvo/jN4fEudH2+XwtVfQVzQwBVpYAyQU7mQ5xblmQI Mn+VKYcahxN497hRBwIyyOY81iZKgwKrc4YetZyK/OapfHEy5wZ20RxNpvp8B+tcpzW9BuHnBRArl FHwnFLYu4cic7ZaJQ/hLGqicmo1F+ETThxrXZR7IMRN1AKe65hgfn+59fsL6s5QsjCjy+EJsjC0Vn Wj9u52VWeydelazHApSx8Drber1qQ0zZqaJH4xQYCKHWjyIVmGBy/wjagwWIPtDi8C7zmcYuC3dLi ppSa5BJhVZATndEIZ3QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvLg-00Cy7u-2M; Wed, 09 Jun 2021 10:22:13 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvLU-00Cy6Y-VN for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 10:22:02 +0000 Received: by mail-il1-x134.google.com with SMTP id v13so24783276ilh.13 for ; Wed, 09 Jun 2021 03:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t6UzJhB8g25TMzOtGb3r8/gh9ASR2geRTCyrguQiy0w=; b=GJET2NWNYXS+LFAAxUpFrmk9Zs7bAnwHE3iuLB/rW1YsDSh9m8c4wKe+w0WDgnF6h1 L0P0t98uOT2QI8Eu6XEGTuekKwVpnefqz68t3F6ymbfd+Woiao0MnygGP9Gf33kpDqcr dC9RsRwfgledY4JWR/EWy/EEAoptSenxW2M8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t6UzJhB8g25TMzOtGb3r8/gh9ASR2geRTCyrguQiy0w=; b=HQCGbwTUttUy0+0JcHEywxeTBEe9Atzw8qB2BMMz73UezZw6nJEPUXfZn+zG3PHvE5 qYnovEKP+8yob3DiS8a5N4J/qo8PjpzlnZzer5vGgigSdYKARATOS0A5Hc6I4OvW5/zf UQc4gGMRYfkptD0bCznPcW/yv2MQKaDVaLFtrLKimFc6TObJ8tpxDZanqREZRnFUOuZM g7sWYeJ2FIz2RG7pARbufsYE0AiRl/pWRbeM/m76Acx9MNxnOTptyxUeXKrN/8O4UXK6 cOC9oeaY1hCJ4R7hIi5Gj9GeizAYXYRy9XS//6STgsTtWAMp261A44jWlPH8DcCsRUA/ u37Q== X-Gm-Message-State: AOAM530rRdxO7lffPEObQFY+8btn3GubzDUWS2g3bD0BxRL1tV1Nvatg 4/l0roSpxGFGEsG4Bz1x9ffyCoWOetn6QA== X-Google-Smtp-Source: ABdhPJwySGAKJaWk8p7qcgR2a4XdI8M4w7DkranM4oc5NfSxNkQ7K8UfhiEJgxI9uLPEhcyvQny0Bw== X-Received: by 2002:a5d:914a:: with SMTP id y10mr22879417ioq.156.1623234118960; Wed, 09 Jun 2021 03:21:58 -0700 (PDT) Received: from mail-il1-f169.google.com (mail-il1-f169.google.com. [209.85.166.169]) by smtp.gmail.com with ESMTPSA id k12sm1224281ioh.26.2021.06.09.03.21.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 03:21:58 -0700 (PDT) Received: by mail-il1-f169.google.com with SMTP id t6so17711801iln.8 for ; Wed, 09 Jun 2021 03:21:58 -0700 (PDT) X-Received: by 2002:a92:d312:: with SMTP id x18mr22776588ila.90.1623234117697; Wed, 09 Jun 2021 03:21:57 -0700 (PDT) MIME-Version: 1.0 References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> <20210517173314.140912-9-gene.chen.richtek@gmail.com> In-Reply-To: From: Fei Shao Date: Wed, 9 Jun 2021 18:21:21 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 08/10] mfd: mt6360: Fix flow which is used to check ic exist To: Gene Chen Cc: lee.jones@linaro.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_032201_098691_5211BDB9 X-CRM114-Status: GOOD ( 25.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 9, 2021 at 6:02 PM Fei Shao wrote: > > On Tue, May 18, 2021 at 1:36 AM Gene Chen wrote: > > > > From: Gene Chen > > > > Fix flow which is used to check ic exist. > > > > Signed-off-by: Gene Chen > > Acked-for-MFD-by: Lee Jones > > --- > > drivers/mfd/mt6360-core.c | 32 +++++++++++++++++++++----------- > > 1 file changed, 21 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c > > index 50a170065a98..cdd99770f94a 100644 > > --- a/drivers/mfd/mt6360-core.c > > +++ b/drivers/mfd/mt6360-core.c > > @@ -293,6 +293,25 @@ static const struct mfd_cell mt6360_devs[] = { > > NULL, 0, 0, "mediatek,mt6360-tcpc"), > > }; > > > > +static int mt6360_check_vendor_info(struct mt6360_ddata *ddata) > > +{ > > + u32 info; > > + int ret; > > + > > + ret = regmap_read(ddata->regmap, MT6360_PMU_DEV_INFO, &info); > > + if (ret < 0) > > A dev_err() to indicate the read info error? (it used to be there) Oops sorry I didn't realize that the patches are applied. Will send another one for the minor fixes. > > > + return ret; > > + > > + if ((info & CHIP_VEN_MASK) != CHIP_VEN_MT6360) { > > + dev_err(ddata->dev, "Device not supported\n"); > > + return -ENODEV; > > + } > > + > > + ddata->chip_rev = info & CHIP_REV_MASK; > > + > > + return 0; > > +} > > + > > static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { > > MT6360_PMU_SLAVEID, > > MT6360_PMIC_SLAVEID, > > @@ -303,7 +322,6 @@ static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { > > static int mt6360_probe(struct i2c_client *client) > > { > > struct mt6360_ddata *ddata; > > - unsigned int reg_data; > > int i, ret; > > > > ddata = devm_kzalloc(&client->dev, sizeof(*ddata), GFP_KERNEL); > > @@ -319,17 +337,9 @@ static int mt6360_probe(struct i2c_client *client) > > return PTR_ERR(ddata->regmap); > > } > > > > - ret = regmap_read(ddata->regmap, MT6360_PMU_DEV_INFO, ®_data); > > - if (ret) { > > - dev_err(&client->dev, "Device not found\n"); > > + ret = mt6360_check_vendor_info(ddata); > > + if (ret) > > return ret; > > - } > > - > > - ddata->chip_rev = reg_data & CHIP_REV_MASK; > > - if (ddata->chip_rev != CHIP_VEN_MT6360) { > > - dev_err(&client->dev, "Device not supported\n"); > > - return -ENODEV; > > - } > > > > ret = devm_regmap_add_irq_chip(&client->dev, ddata->regmap, client->irq, > > 0, 0, &mt6360_irq_chip, > > -- > > 2.25.1 > > > > > > _______________________________________________ > > Linux-mediatek mailing list > > Linux-mediatek@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-mediatek _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel