forked from mirrors/linux
		
	mmc: renesas_sdhi: use MMC_CAP2_NO_WRITE_PROTECT instead of TMIO own flag
TMIO_MMC_WRPROTECT_DISABLE is equivalent to MMC_CAP2_NO_WRITE_PROTECT.
The flag is propagated as follows:
       renesas_sdhi_of_data::capabilities2
    -> tmio_mmc_data::capabilities2
    -> mmc_host::caps2
Only the difference is the TMIO_... makes tmio_mmc_get_ro() return 0
(i.e. it does not affect mmc_gpio_get_ro() at all), while MMC_CAP2_...
returns 0 before calling ->get_ro() hook (i.e. it affects both IP own
logic and GPIO detection).
The TMIO MMC drivers do not set-up gpio_ro by themselves.  Only the
possibility, if any, would be DT specifies "wp-gpios" property, and
gpio_ro is set by mmc_gpiod_request_ro() called from mmc_of_parse().
However, it does not make sense to specify "wp-gpios" property and
TMIO_MMC_WRPROTECT_DISABLE at the same time.
I checked under arch/arm/boot/dts/ and arch/arm64/boot/dts/renesas/,
and I did not see any Renesas boards with "wp-gpios".  So, this
conversion should be safe.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
			
			
This commit is contained in:
		
							parent
							
								
									7f7a385d0a
								
							
						
					
					
						commit
						2ad1db059b
					
				
					 2 changed files with 11 additions and 11 deletions
				
			
		|  | @ -71,11 +71,11 @@ static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| static const struct renesas_sdhi_of_data of_rcar_gen3_compatible = { | static const struct renesas_sdhi_of_data of_rcar_gen3_compatible = { | ||||||
| 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE | | 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL | | ||||||
| 			  TMIO_MMC_CLK_ACTUAL | TMIO_MMC_HAVE_CBSY | | 			  TMIO_MMC_HAVE_CBSY | TMIO_MMC_MIN_RCAR2, | ||||||
| 			  TMIO_MMC_MIN_RCAR2, |  | ||||||
| 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | | 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | | ||||||
| 			  MMC_CAP_CMD23, | 			  MMC_CAP_CMD23, | ||||||
|  | 	.capabilities2	= MMC_CAP2_NO_WRITE_PROTECT, | ||||||
| 	.bus_shift	= 2, | 	.bus_shift	= 2, | ||||||
| 	.scc_offset	= 0x1000, | 	.scc_offset	= 0x1000, | ||||||
| 	.taps		= rcar_gen3_scc_taps, | 	.taps		= rcar_gen3_scc_taps, | ||||||
|  |  | ||||||
|  | @ -40,9 +40,9 @@ static const struct renesas_sdhi_of_data of_rz_compatible = { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| static const struct renesas_sdhi_of_data of_rcar_gen1_compatible = { | static const struct renesas_sdhi_of_data of_rcar_gen1_compatible = { | ||||||
| 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE | | 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL, | ||||||
| 			  TMIO_MMC_CLK_ACTUAL, |  | ||||||
| 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, | 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, | ||||||
|  | 	.capabilities2	= MMC_CAP2_NO_WRITE_PROTECT, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| /* Definitions for sampling clocks */ | /* Definitions for sampling clocks */ | ||||||
|  | @ -58,11 +58,11 @@ static struct renesas_sdhi_scc rcar_gen2_scc_taps[] = { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| static const struct renesas_sdhi_of_data of_rcar_gen2_compatible = { | static const struct renesas_sdhi_of_data of_rcar_gen2_compatible = { | ||||||
| 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE | | 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL | | ||||||
| 			  TMIO_MMC_CLK_ACTUAL | TMIO_MMC_HAVE_CBSY | | 			  TMIO_MMC_HAVE_CBSY | TMIO_MMC_MIN_RCAR2, | ||||||
| 			  TMIO_MMC_MIN_RCAR2, |  | ||||||
| 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | | 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | | ||||||
| 			  MMC_CAP_CMD23, | 			  MMC_CAP_CMD23, | ||||||
|  | 	.capabilities2	= MMC_CAP2_NO_WRITE_PROTECT, | ||||||
| 	.dma_buswidth	= DMA_SLAVE_BUSWIDTH_4_BYTES, | 	.dma_buswidth	= DMA_SLAVE_BUSWIDTH_4_BYTES, | ||||||
| 	.dma_rx_offset	= 0x2000, | 	.dma_rx_offset	= 0x2000, | ||||||
| 	.scc_offset	= 0x0300, | 	.scc_offset	= 0x0300, | ||||||
|  | @ -79,11 +79,11 @@ static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| static const struct renesas_sdhi_of_data of_rcar_gen3_compatible = { | static const struct renesas_sdhi_of_data of_rcar_gen3_compatible = { | ||||||
| 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE | | 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL | | ||||||
| 			  TMIO_MMC_CLK_ACTUAL | TMIO_MMC_HAVE_CBSY | | 			  TMIO_MMC_HAVE_CBSY | TMIO_MMC_MIN_RCAR2, | ||||||
| 			  TMIO_MMC_MIN_RCAR2, |  | ||||||
| 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | | 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | | ||||||
| 			  MMC_CAP_CMD23, | 			  MMC_CAP_CMD23, | ||||||
|  | 	.capabilities2	= MMC_CAP2_NO_WRITE_PROTECT, | ||||||
| 	.bus_shift	= 2, | 	.bus_shift	= 2, | ||||||
| 	.scc_offset	= 0x1000, | 	.scc_offset	= 0x1000, | ||||||
| 	.taps		= rcar_gen3_scc_taps, | 	.taps		= rcar_gen3_scc_taps, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Masahiro Yamada
						Masahiro Yamada