From: micky_ching@realsil•com.cn (micky)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 2/4] mfd: rtsx: Generify the switch voltage routine
Date: Fri, 15 Nov 2013 10:59:02 +0800 [thread overview]
Message-ID: <52858DF6.7010800@realsil.com.cn> (raw)
In-Reply-To: <1384421355-4434-3-git-send-email-lee.jones@linaro.org>
Hi Lee
Thank you for your work.
Switch output voltage may have some problem here.
1. modify params of function in pcr_ops may affect other chips, like
rts52xx, and we may add other registers or value in the future, just
add params may not enough to handle this case. So I think different
chip should use a different function here, and modify the function
will not affect others.
2. rtl8402 has another difference with 8411 here, it doesn't use
BPP_ASIC_1V8, but use BPP_ASIC_2V0.
so, I will send another patch to fix this problem.
> -static int rtl8411_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
> +static int rtl84xx_switch_output_voltage(struct rtsx_pcr *pcr,
> + u8 voltage, int shift)
> {
> u8 mask, val;
> int err;
>
> - mask = (BPP_REG_TUNED18 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_MASK;
> + mask = (BPP_REG_TUNED18 << shift) | BPP_PAD_MASK;
> if (voltage == OUTPUT_3V3) {
> err = rtsx_pci_write_register(pcr,
> SD30_DRIVE_SEL, 0x07, pcr->sd30_drive_sel_3v3);
> if (err < 0)
> return err;
> - val = (BPP_ASIC_3V3 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_3V3;
> + val = (BPP_ASIC_3V3 << shift) | BPP_PAD_3V3;
> } else if (voltage == OUTPUT_1V8) {
> err = rtsx_pci_write_register(pcr,
> SD30_DRIVE_SEL, 0x07, pcr->sd30_drive_sel_1v8);
> if (err < 0)
> return err;
> - val = (BPP_ASIC_1V8 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_1V8;
> + val = (BPP_ASIC_1V8 << shift) | BPP_PAD_1V8;
> } else {
> return -EINVAL;
> }
--
Best Regards
Micky.
next prev parent reply other threads:[~2013-11-15 2:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 9:29 [PATCH 0/4] mfd: rtsx: Decrease driver size and add new device Lee Jones
2013-11-14 9:29 ` [PATCH 1/4] mfd: rtsx: Generify call-back operations in order to reduce code duplication Lee Jones
2013-11-15 3:43 ` [PATCH 1/4] mfd: rtsx: Generify call-back operations in orderto " micky
2013-11-14 9:29 ` [PATCH 2/4] mfd: rtsx: Generify the switch voltage routine Lee Jones
2013-11-15 2:59 ` micky [this message]
2013-11-15 15:37 ` Lee Jones
2013-11-14 9:29 ` [PATCH 3/4] mfd: rtsx: Add rtl8402 card reader Lee Jones
2013-11-14 9:29 ` [PATCH 4/4] mfd: rtsx: Prevent 'used uninitialised' warnings Lee Jones
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=52858DF6.7010800@realsil.com.cn \
--to=micky_ching@realsil$(echo .)com.cn \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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