From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tuomas Tynkkynen Date: Thu, 21 Dec 2017 16:09:46 +0200 Subject: [U-Boot] [PATCH 1/2] mmc: sunxi: Support cd-inverted DT property In-Reply-To: <20171221130916.lswqyibpzlt4liqz@flea.lan> References: <20171218200942.23586-1-tuomas@tuxera.com> <20171220122608.yinlyqijwaladred@flea.lan> <1513776887.5797.11.camel@tuxera.com> <20171221130916.lswqyibpzlt4liqz@flea.lan> Message-ID: <1513865386.32354.10.camel@tuxera.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 2017-12-21 at 14:09 +0100, Maxime Ripard wrote: > > sunxi_gpio_set_pull(cd_pin, SUNXI_GPIO_PULL_UP); > > } > > > > So: if the DT specifies GPIO_ACTIVE_LOW, dm_gpio_get_value() > > does its own inversion of the GPIO level. Then, on top of that > > we do another inversion if the "cd-inverted" property was > > specified. > > This matches what the Linux MMC driver does. > > Hmmm, right. > > I guess in your particular case then, you'd be better off droping the > cd-inverted property. Like I said, it's really legacy these days. > That > of course doesn't prevent the rest of the patch to go in. Yes, getting rid of the cd-inverted properties from the DTs should make card detection work without any code changes. So the plan of action will be: - Drop cd-inverted from U-Boot's sun7i-a20-pcduino3.dts - Flip the GPIO_ACTIVE_* around + drop cd-inverted from Linux DTs - Re-sync DTs from Linux to U-Boot - Finally switch all sunxi boards to DM_MMC in U-Boot