From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752188AbcHLC6N (ORCPT ); Thu, 11 Aug 2016 22:58:13 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:47074 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbcHLC6M (ORCPT ); Thu, 11 Aug 2016 22:58:12 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 addr_info_check: 0 X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: devicetree@vger.kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH v2 0/6] Add support of inverting power control and some minor cleanup To: Jaehoon Chung , Shawn Lin , Ulf Hansson References: <1470533618-16312-1-git-send-email-shawn.lin@rock-chips.com> <9227304b-4d2e-66e1-743a-8d06f2a10ce1@samsung.com> Cc: shawn.lin@rock-chips.com, Rob Herring , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Heiko Stuebner , linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org From: Shawn Lin Message-ID: <8f20c3d2-2c73-18f2-0104-f7bc715c7b15@rock-chips.com> Date: Fri, 12 Aug 2016 10:57:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <9227304b-4d2e-66e1-743a-8d06f2a10ce1@samsung.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/8/11 18:08, Jaehoon Chung wrote: > Hi Shawn, > > On 08/09/2016 10:49 AM, Shawn Lin wrote: >> Hi, >> >> On 2016/8/8 18:24, Jaehoon Chung wrote: >>> Hi Shawn, >>> >>> On 08/07/2016 10:33 AM, Shawn Lin wrote: >>>> By default, dw_mmc outputs high level voltage to indicate powering >>>> up the card and outputs low level vcltage to indicate powering >>>> off the card. But that is not always correct. The power io should >>>> be able to control different kind of hw components to supply or >>>> cutoff power to the card. We have boards that need this patchset >>>> to make the power control correct. Meanwhile let's expose it to >>>> DT for board-specific usage. >>> >>> I have a question for this patch-set. Does DWMMC IP support to invert ON/OFF at Power Enable register? >> >> No. >> >>> Hmm..Well, if use the DW_MMC_CARD_PWR_INVERT, it should also be the similar behavior with Quirks. >> >> yup, it makes the power control more complicated than before. :( >> >>> >>> Other flags are related with dwmmc IP. But this flag (DW_MMC_CARD_PWR_INVERT) is not related with IP side. >>> I understood why you needs to add this flag..Is rockchip designed to invert the power controlling? >> >> We don't invert the power controlling but our customers do. >> The HW componet looks like some discrete LDOs which enable the related >> power supply when outputing low voltage from pwren.. > > Is it related with PWREN register? > I'm checking the TRM for PWREN register.. > > "Optional feature; ports can be used as general-purpose outputs." > > Does it use the ports as GPIO? > >> >>> >>> But it's not general case. We can discuss about this. >> >> I have a solution which is to add gpio power control for slot-gpio of >> mmc core. once finished, we could add pwr_cap_invert just like what we >> did for cd/wp invert control.. > > I'm not sure that it's right that add the gpio power control into mmc core. > slot-gpio? i think it can use the regulator framework with gpio. yup, I'm looking this and seems it's fine to register a regulator-gpio and stuff it for vmmc-supply of sdmmc. I will test it, really helpful. thanks! > I don't have a lot knowledge of power, but it might be controlled whether active is low or high. > So i think it doesn't need to add for entire mmc controller. > > Best Regards, > Jaehoon Chung > >> >> Then we could remove PWREN from the default state of >> pinctrl inside the sdmmc dt node, and let dwmmc request gpio power >> control stuff after paring the property for pwr_cap_invert.. >> >> More over, it well fit for all mmc host's requirement of gpio >> power control and inverted control if they want it. :) >> >> >> That should be legit for us? >> If it sounds ok to you and Ulf, I will come up with a RFC one for >> community to comment it.:) >> >>> >>> Best Regards, >>> Jaehoon Chung >>> >>>> >>>> >>>> Changes in v2: >>>> - fix copy-paste err and typo >>>> >>>> Shawn Lin (6): >>>> dt-bindings: rockchip-dw-mshc: add description of >>>> rockchip,power-invert >>>> mmc: dw_mmc: cleanup power setting of set_ios callback >>>> mmc: dw_mmc: split out dw_mci_set_power >>>> mmc: dw_mmc: split out dw_mci_set_power_reg >>>> mmc: dw_mmc: support inverted power control >>>> mmc: dw_mmc-rockchip: add parsing of power control from DT >>>> >>>> .../devicetree/bindings/mmc/rockchip-dw-mshc.txt | 6 + >>>> drivers/mmc/host/dw_mmc-rockchip.c | 8 ++ >>>> drivers/mmc/host/dw_mmc.c | 134 ++++++++++++--------- >>>> drivers/mmc/host/dw_mmc.h | 1 + >>>> 4 files changed, 90 insertions(+), 59 deletions(-) >>>> >>> >>> >>> >>> >> >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Best Regards Shawn Lin