File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,9 @@ static void dw_mci_rockchip_platfm_shutdown(struct platform_device *pdev)
311311{
312312 struct dw_mci * host = platform_get_drvdata (pdev );
313313 struct mmc_host * mmc = host -> slot [0 ]-> mmc ;
314- int ret ;
314+ struct device_node * np = host -> dev -> of_node ;
315+ int ret , gpio ;
316+ enum of_gpio_flags flags ;
315317
316318 mdelay (20 );
317319
@@ -320,6 +322,22 @@ static void dw_mci_rockchip_platfm_shutdown(struct platform_device *pdev)
320322
321323 if (!IS_ERR (mmc -> supply .vqmmc ))
322324 regulator_set_voltage (mmc -> supply .vqmmc , 3000000 , 3300000 );
325+
326+ gpio = of_get_named_gpio_flags (np , "maskrom_gpio" , 0 , & flags );
327+
328+ if (gpio_is_valid (gpio )) {
329+ if (!gpio_request (gpio , "maskrom_gpio" )) {
330+ if (!gpio_direction_output (gpio , 0 )) {
331+ gpio_free (gpio );
332+ dev_info (host -> dev , "set maskrom gpio to low\n" );
333+ }else {
334+ gpio_free (gpio );
335+ dev_err (host -> dev , "maskrom_gpio set low fail\n" );
336+ }
337+ }else {
338+ dev_err (host -> dev , "maskrom_gpio request fail\n" );
339+ }
340+ }
323341}
324342
325343#ifdef CONFIG_PM_SLEEP
You can’t perform that action at this time.
0 commit comments