mmc: fsl: introduce wp_enable
authorPeng Fan <van.freenix@gmail.com>
Wed, 15 Jun 2016 02:53:02 +0000 (10:53 +0800)
committerYork Sun <york.sun@nxp.com>
Tue, 28 Jun 2016 19:08:53 +0000 (12:08 -0700)
commit1483151e84161449c3f652a751a04e06b0723bff
treee51ba2518e0dfb3e457e1f1029870bf37d78429f
parent84ecdf6da9eb102b2de87d5912d1554f44d33237
mmc: fsl: introduce wp_enable

Introudce wp_enable. To check WPSPL, wp_enable needs to be set
to 1 in board code.

Take i.MX6UL for example, for some boards, they do not use WP singal,
so they does not configure USDHC1_WP_SELECT_INPUT, and its default
value is 0(GPIO1_IO02). However GPIO1_IO02 is muxed for i2c usage and
SION bit set. So USDHC controller can always get wp signal and WPSPL
shows write protect and blocks driver continuing. This is not what
we want to see, so add wp_enable, and if set to 0, just omit the
WPSPL checking and this does not effect normal working of usdhc
controller.

If wp-gpios is provided in dts, wp_enable is set to 1, otherwise 0.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
drivers/mmc/fsl_esdhc.c
include/fsl_esdhc.h