Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2709364iog; Mon, 20 Jun 2022 03:04:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vRWk24Wu59fE+1Piv2FhQQ+zoSuvu8lyOrAqewffv24qP7Ng6rJI/LQZJ7lsW+WmMbzgh9 X-Received: by 2002:a05:6402:3329:b0:435:8136:cb70 with SMTP id e41-20020a056402332900b004358136cb70mr4696633eda.106.1655719443385; Mon, 20 Jun 2022 03:04:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655719443; cv=none; d=google.com; s=arc-20160816; b=Zt2kQSFj7+Rp5D582JFWo5d/ff+1/CNsQ5+FzawbnHubi1coDLStknDVqYt0DKfABi hkLdnxEttQIyzdhR0x/LiMAuM5qJfMqSvicIw/1dvg01klYrneo/jllXGuGWFKFR/Qum hdMWIK2/erYCrmJ6LKicS5tLYN70NM0J/wXa3xhFF2k/f6MzEiLW0anMQgak91tNMRAO zwBLK6bFx96OFPw2hWKivLoIRvkkKMn2Ag1KcZa4OswrciA5E250JcQhDBL1QzWYEYwf cfrzItVFwbCb4fO2fUH/7JZV0w/dAnZsEGY3O5ZaJhhmz20CddV/s66Ne3sFRXDYGL56 IewA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xbydWtTEQ7/9ZWZC+wL+2zf+Ge3aJVYC062WRrIfkg0=; b=jfA+Ih4WUQ9TIfJO8CFmO2WotSqnhWk2BW/dupF+TsI8weRtvM1cUEK6Uo0G68IDK2 XJUIh7ujsvDUP6lUSFjLk5CsPdoI7v1qGTbyBkG0uP6URllMx+CyWBbtegb/8CLSDAu7 Eoht6p5V2jyh4BGLn3l7/Li164sr1vg9HvcISKo2J+daBJRzqtV0OgTBR6T/e9TZ5lh4 wjs891d74zGDb1/B5mq+jaHs4vn29KUF3EJT7neDg+FkxyZfvWLpEjrfo3GtLHmIF9NH 00EKPos8NoblwFCIgJ+n84mSSo75tlvrezaaw4cCVFz+PKFwbiEQK/bFEhCgFpV2a/i9 amkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mbk+soIB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr15-20020a1709073f8f00b0071097667454si13100790ejc.800.2022.06.20.03.03.37; Mon, 20 Jun 2022 03:04:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mbk+soIB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233274AbiFTJZH (ORCPT + 99 others); Mon, 20 Jun 2022 05:25:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240250AbiFTJZE (ORCPT ); Mon, 20 Jun 2022 05:25:04 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C0B912604 for ; Mon, 20 Jun 2022 02:25:03 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id b7so11209818ljr.6 for ; Mon, 20 Jun 2022 02:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xbydWtTEQ7/9ZWZC+wL+2zf+Ge3aJVYC062WRrIfkg0=; b=Mbk+soIB+gNfMR++dR/N+4RrxMk+FZPgSYoBYMP9pou/tI+pWFRwGuTSczx+EozJMM AlWDarxHpI0bFfguGDaFHOWJiZFfzgbrnBrrdSo7xFyxD0vBX4AWFDUpmaZuIP7xLTIx mTI4GfPzBs2Ct0G8Wqm8uCPENtr0UfB/0GqpO16cn3oHYgMLN3IuwLS+BDjCtni3PTKC ECH48h6wOHRc4UpHhzjWKaj2BbBCsCjb0AL6Kw8+muEnVUSkdl4XyWcWEw9YuiqQIYY9 H7euaxE/MOH7LimSFjVo5SszxacqZL9xIWMPDHMYuBM72bqcNWOKz1LjskbBgg1ZtC74 6HnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xbydWtTEQ7/9ZWZC+wL+2zf+Ge3aJVYC062WRrIfkg0=; b=Ipl71b27B+jDSierHiqyeyhDi8GQhTDamBMsqYGOUM9r3bgHj/oPCHpupjFbw3S2qZ VQQ0j3Yx9202s4eRNH5RiOCcpKDvM0DErB0QRxM2PaisL14pp3JVwODMl2Q3TRpbCNtx rwkFuV9+/SavpwhPy0iUYXzsI5SvzB4aL+m+D/vsRXszp7UqkHtD/xgEy5FlbhjajnVx Sv4jGQWsXy1XmzFClBqT3TQritzAbOO8IqbupaZc1JeGRWbHhrHU1z3kuI5WNIN+3Bpx a13fyYso4rGNm1gN9krW0gmJV9Zysa3ioz+ppd/eE84mhjYpFrXQsGl1iS788Ns3eReG P3TQ== X-Gm-Message-State: AJIora/todks6zbfxEacgJv72rtULzwcUkdbCKetaUZbuqHhanqYrBvh ETzRlhNgQNvKeUc/kW3HUrfkmvC05rWotw== X-Received: by 2002:a2e:964a:0:b0:25a:66ac:70e with SMTP id z10-20020a2e964a000000b0025a66ac070emr4082158ljh.147.1655717101522; Mon, 20 Jun 2022 02:25:01 -0700 (PDT) Received: from mutt (c-7303e555.07-21-73746f28.bbcust.telenor.se. [85.229.3.115]) by smtp.gmail.com with ESMTPSA id e17-20020a195011000000b00478e9b28fe4sm1699729lfb.80.2022.06.20.02.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 02:25:01 -0700 (PDT) Date: Mon, 20 Jun 2022 11:24:59 +0200 From: Anders Roxell To: Stanley Chu Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, martin.petersen@oracle.com, avri.altman@wdc.com, alim.akhtar@samsung.com, jejb@linux.ibm.com, bvanassche@acm.org, peter.wang@mediatek.com, chun-hung.wu@mediatek.com, alice.chao@mediatek.com, powen.kao@mediatek.com, mason.zhang@mediatek.com, qilin.tan@mediatek.com, lin.gui@mediatek.com, eddie.huang@mediatek.com, tun-yu.yu@mediatek.com, cc.chou@mediatek.com, chaotian.jing@mediatek.com, jiajie.hao@mediatek.com Subject: Re: [PATCH v5 10/11] scsi: ufs-mediatek: Support multiple VCC sources Message-ID: <20220620092459.GA37723@mutt> References: <20220616053725.5681-1-stanley.chu@mediatek.com> <20220616053725.5681-11-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220616053725.5681-11-stanley.chu@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-06-16 13:37, Stanley Chu wrote: > Support multiple VCC source in MediaTek UFS platforms. > > Two options are provided and distinguished by specific > device tree attributes as below examples, > > [Option 1: By numbering] > mediatek,ufs-vcc-by-num; > vcc-opt1-supply = <&mt6373_vbuck4_ufs>; > vcc-opt2-supply = <&mt6363_vemc>; > > [Option 2: By UFS version] > mediatek,ufs-vcc-by-ver; > vcc-ufs3-supply = <&mt6373_vbuck4_ufs>; > > Signed-off-by: Alice Chao > Signed-off-by: Peter Wang > Signed-off-by: Stanley Chu > --- > drivers/ufs/host/ufs-mediatek.c | 46 ++++++++++++++++++++++++++++++++- > drivers/ufs/host/ufs-mediatek.h | 14 ++++++++++ > 2 files changed, 59 insertions(+), 1 deletion(-) > > diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c > index e756aba45acd..34e51c094366 100755 > --- a/drivers/ufs/host/ufs-mediatek.c > +++ b/drivers/ufs/host/ufs-mediatek.c > @@ -669,6 +669,49 @@ static u32 ufs_mtk_get_ufs_hci_version(struct ufs_hba *hba) > return hba->ufs_version; > } > > +#define MAX_VCC_NAME 30 > +static int ufs_mtk_vreg_fix_vcc(struct ufs_hba *hba) > +{ > + struct ufs_vreg_info *info = &hba->vreg_info; > + struct device_node *np = hba->dev->of_node; > + struct device *dev = hba->dev; > + char vcc_name[MAX_VCC_NAME]; > + struct arm_smccc_res res; > + int err, ver; > + > + if (hba->vreg_info.vcc) > + return 0; > + > + if (of_property_read_bool(np, "mediatek,ufs-vcc-by-num")) { > + ufs_mtk_get_vcc_num(res); > + if (res.a1 > UFS_VCC_NONE && res.a1 < UFS_VCC_MAX) > + snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%u", res.a1); Building this showes the following build warning/error drivers/ufs/host/ufs-mediatek.c: In function 'ufs_mtk_vreg_fix_vcc': drivers/ufs/host/ufs-mediatek.c:688:67: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] 688 | snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%u", res.a1); | ~^ ~~~~~~ | | | | | long unsigned int | unsigned int | %lu cc1: all warnings being treated as errors Cheers, Anders