public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anders Roxell <anders.roxell@linaro.org>
To: Stanley Chu <stanley.chu@mediatek.com>
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
Date: Mon, 20 Jun 2022 11:24:59 +0200	[thread overview]
Message-ID: <20220620092459.GA37723@mutt> (raw)
In-Reply-To: <20220616053725.5681-11-stanley.chu@mediatek.com>

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 <alice.chao@mediatek.com>
> Signed-off-by: Peter Wang <peter.wang@mediatek.com>
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> ---
>  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

  reply	other threads:[~2022-06-20  9:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16  5:37 [PATCH v5 00/11] scsi: ufs: Fix PMC and low-power mode on MediaTek UFS platforms Stanley Chu
2022-06-16  5:37 ` [PATCH v5 01/11] scsi: ufs: Export ufshcd_uic_change_pwr_mode() Stanley Chu
2022-06-16  5:37 ` [PATCH v5 02/11] scsi: ufs: Fix ADAPT logic for HS-G5 Stanley Chu
2022-06-16  5:37 ` [PATCH v5 03/11] scsi: ufs-mediatek: Introduce workaround for power mode change Stanley Chu
2022-06-16  5:37 ` [PATCH v5 04/11] scsi: ufs-mediatek: Fix the timing of configuring device regulators Stanley Chu
2022-06-16  5:37 ` [PATCH v5 05/11] scsi: ufs-mediatek: Prevent device regulators setting as LPM incorrectly Stanley Chu
2022-06-16  5:37 ` [PATCH v5 06/11] scsi: ufs-mediatek: Support low-power mode for VCCQ Stanley Chu
2022-06-16  5:37 ` [PATCH v5 07/11] scsi: ufs-mediatek: Support flexible parameters for smc calls Stanley Chu
2022-06-16  5:37 ` [PATCH v5 08/11] scsi: ufs-mediatek: Support low-power mode for parents of VCCQx Stanley Chu
2022-06-16  5:37 ` [PATCH v5 09/11] scsi: ufs: Export regulator functions Stanley Chu
2022-06-16  5:37 ` [PATCH v5 10/11] scsi: ufs-mediatek: Support multiple VCC sources Stanley Chu
2022-06-20  9:24   ` Anders Roxell [this message]
2022-06-16  5:37 ` [PATCH v5 11/11] scsi: ufs-mediatek: Disable unused VCCQx power rails Stanley Chu
2022-06-17  2:10 ` [PATCH v5 00/11] scsi: ufs: Fix PMC and low-power mode on MediaTek UFS platforms Martin K. Petersen
2022-06-22  2:10 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220620092459.GA37723@mutt \
    --to=anders.roxell@linaro.org \
    --cc=alice.chao@mediatek.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=cc.chou@mediatek.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=eddie.huang@mediatek.com \
    --cc=jejb@linux.ibm.com \
    --cc=jiajie.hao@mediatek.com \
    --cc=lin.gui@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mason.zhang@mediatek.com \
    --cc=peter.wang@mediatek.com \
    --cc=powen.kao@mediatek.com \
    --cc=qilin.tan@mediatek.com \
    --cc=stanley.chu@mediatek.com \
    --cc=tun-yu.yu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox