From: lin tao Date: Mon, 16 Jun 2014 07:46:50 +0000 (+0800) Subject: mmc: remove unused macro tag X-Git-Tag: firefly_0821_release~5103 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a866ee23062c925b069476d32f7f7d40be279860;p=firefly-linux-kernel-4.4.55.git mmc: remove unused macro tag --- diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile index 82c471324ca8..d4034e98af83 100755 --- a/drivers/mmc/host/Makefile +++ b/drivers/mmc/host/Makefile @@ -46,7 +46,7 @@ obj-$(CONFIG_MMC_DW) += rk_sdmmc.o obj-$(CONFIG_MMC_DW_PLTFM) += dw_mmc-pltfm.o # To Specific Extensions for Synopsys DW Multimedia Card Interface in Rockchip Soc. Added by XBW. -obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o rk_sdmmc_of.o rk_sdmmc_ops.o +obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o rk_sdmmc_dbg.o rk_sdmmc_ops.o obj-$(CONFIG_MMC_DW_EXYNOS) += dw_mmc-exynos.o obj-$(CONFIG_MMC_DW_PCI) += dw_mmc-pci.o diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c index 9982c2807d09..e1b5d418f18e 100755 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -24,7 +24,7 @@ #include "dw_mmc-pltfm.h" #include "../../clk/rockchip/clk-ops.h" -#include "rk_sdmmc_of.h" +#include "rk_sdmmc_dbg.h" /*CRU SDMMC TUNING*/ /* @@ -542,32 +542,11 @@ static const struct of_device_id dw_mci_rockchip_match[] = { }; MODULE_DEVICE_TABLE(of, dw_mci_rockchip_match); -#if DW_MMC_OF_PROBE -extern void rockchip_mmc_of_probe(struct device_node *np,struct rk_sdmmc_of *mmc_property); -#endif - static int dw_mci_rockchip_probe(struct platform_device *pdev) { const struct dw_mci_drv_data *drv_data; const struct of_device_id *match; - #if DW_MMC_OF_PROBE - struct device_node *np = pdev->dev.of_node; - struct rk_sdmmc_of *rk_mmc_property = NULL; - - rk_mmc_property = (struct rk_sdmmc_of *)kmalloc(sizeof(struct rk_sdmmc_of),GFP_KERNEL); - if(NULL == rk_mmc_property) - { - kfree(rk_mmc_property); - rk_mmc_property = NULL; - printk("rk_mmc_property malloc space failed!\n"); - return 0; - } - - rockchip_mmc_of_probe(np,rk_mmc_property); - #endif /*DW_MMC_OF_PROBE*/ - - match = of_match_node(dw_mci_rockchip_match, pdev->dev.of_node); drv_data = match->data; return dw_mci_pltfm_register(pdev, drv_data); diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index a377af381310..52c706c109aa 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -44,7 +44,7 @@ #include #include "rk_sdmmc.h" -#include "rk_sdmmc_of.h" +#include "rk_sdmmc_dbg.h" #include #include "../../clk/rockchip/clk-ops.h" diff --git a/drivers/mmc/host/rk_sdmmc.h b/drivers/mmc/host/rk_sdmmc.h index d506e28e87ba..bca5f992ee64 100755 --- a/drivers/mmc/host/rk_sdmmc.h +++ b/drivers/mmc/host/rk_sdmmc.h @@ -15,7 +15,7 @@ #ifndef _DW_MMC_H_ #define _DW_MMC_H_ -#include "rk_sdmmc_of.h" +#include "rk_sdmmc_dbg.h" #define DW_MMC_240A 0x240a diff --git a/drivers/mmc/host/rk_sdmmc_dbg.c b/drivers/mmc/host/rk_sdmmc_dbg.c new file mode 100755 index 000000000000..fdbe75df5184 --- /dev/null +++ b/drivers/mmc/host/rk_sdmmc_dbg.c @@ -0,0 +1,16 @@ +/* + * Synopsys DesignWare Multimedia Card Interface driver + * + * Copyright (C) 2014 Fuzhou Rockchip Electronics Co.Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include "rk_sdmmc_dbg.h" + +u32 mmc_debug_level= MMC_DBG_BOOT|MMC_DBG_ERROR; +char dbg_flag[]="mmc0mmc1mmc2"; + diff --git a/drivers/mmc/host/rk_sdmmc_dbg.h b/drivers/mmc/host/rk_sdmmc_dbg.h new file mode 100755 index 000000000000..ed77964537a9 --- /dev/null +++ b/drivers/mmc/host/rk_sdmmc_dbg.h @@ -0,0 +1,115 @@ +/* + * Synopsys DesignWare Multimedia Card Interface driver + * + * Copyright (C) 2014 Fuzhou Rockchip Electronics Co.Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef __RK_SDMMC_DBG_H +#define __RK_SDMMC_DBG_H + +#include +#include +#include +#include + + +#define DRIVER_NAME "rk_sdmmc" +#define DRIVER_PREFIX DRIVER_NAME ": " +#define DRIVER_VER "Dw-mci-rockchip" + +enum MMC_DBG_MASK{ + MMC_DBG_NONE = 0, + MMC_DBG_BOOT = BIT(0), + MMC_DBG_ERROR= BIT(1), + MMC_DBG_WARN = BIT(2), + MMC_DBG_INFO = BIT(3), + MMC_DBG_CMD = BIT(4), + MMC_DBG_DBG = BIT(5), + MMC_DBG_SW_VOL = BIT(6), + MMC_DBG_ALL = 0xFF, + +}; + +extern u32 mmc_debug_level; +extern char dbg_flag[]; + +#define MMC_DBG_FUNC_CONFIG 1 +#if MMC_DBG_FUNC_CONFIG +#define MMC_DBG_BOOT_FUNC(mmc_host,fmt, arg...) \ + do { \ + if(mmc_debug_level & MMC_DBG_BOOT) { \ + if(NULL != strpbrk(dbg_flag,mmc_hostname(mmc_host))) { \ + printk(DRIVER_PREFIX "BOOT " fmt "\n", ##arg);\ + } \ + } \ + }while(0) +#define MMC_DBG_ERR_FUNC(mmc_host,fmt, arg...) \ + do{ \ + if(mmc_debug_level & MMC_DBG_ERROR) { \ + if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \ + printk(DRIVER_PREFIX "ERROR " fmt "\n", ##arg);\ + } \ + } \ + }while(0) +#define MMC_DBG_WARN_FUNC(mmc_host,fmt, arg...) \ + do { \ + if(mmc_debug_level & MMC_DBG_WARN) { \ + if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \ + printk(DRIVER_PREFIX "WARN " fmt "\n", ##arg);\ + } \ + } \ + }while(0) +#define MMC_DBG_INFO_FUNC(mmc_host,fmt, arg...) \ + do { \ + if(mmc_debug_level & MMC_DBG_INFO) { \ + if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \ + printk(DRIVER_PREFIX "INFO " fmt "\n", ##arg);\ + } \ + } \ + }while(0) +#define MMC_DBG_CMD_FUNC(mmc_host,fmt, arg...) \ + do { \ + if(mmc_debug_level & MMC_DBG_CMD) { \ + if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \ + printk(DRIVER_PREFIX "CMD " fmt "\n", ##arg);\ + } \ + } \ + }while(0) +#define MMC_DBG_SW_VOL_FUNC(mmc_host,fmt, arg...) \ + do { \ + if(mmc_debug_level & MMC_DBG_SW_VOL) { \ + if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \ + printk(DRIVER_PREFIX "SW-VOL " fmt "\n", ##arg);\ + } \ + } \ + }while(0) +#else +#define MMC_DBG_BOOT_FUNC(mmc_host,fmt, arg...) {printk(DRIVER_PREFIX "BOOT " fmt "\n", ##arg);} +#define MMC_DBG_ERR_FUNC(mmc_host,fmt, arg...) +#define MMC_DBG_WARN_FUNC(mmc_host,fmt, arg...) +#define MMC_DBG_INFO_FUNC(mmc_host,fmt, arg...) +#define MMC_DBG_CMD_FUNC(mmc_host,fmt, arg...) +#define MMC_DBG_SW_VOL_FUNC(mmc_host,fmt, arg...) +#endif + +#if defined(CONFIG_DYNAMIC_DEBUG) + #define mmc_debug(level, fmt, arg...) \ + do { \ + if (unlikely(level & mmc_debug_level)) \ + dynamic_pr_debug(DRIVER_PREFIX fmt "\n", ##arg); \ + } while (0) +#else + #define mmc_debug(level, fmt, arg...) \ + do { \ + if (unlikely(level & mmc_debug_level)) \ + printk(KERN_DEBUG pr_fmt(DRIVER_PREFIX fmt "\n"), \ + ##arg); \ + } while (0) +#endif + +#endif diff --git a/drivers/mmc/host/rk_sdmmc_of.c b/drivers/mmc/host/rk_sdmmc_of.c deleted file mode 100755 index 01a84d454a2e..000000000000 --- a/drivers/mmc/host/rk_sdmmc_of.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Synopsys DesignWare Multimedia Card Interface driver - * - * Copyright (C) 2014 Fuzhou Rockchip Electronics Co.Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ -#include "rk_sdmmc_of.h" - -u32 mmc_debug_level= MMC_DBG_BOOT|MMC_DBG_ERROR;//MMC_DBG_SW_VOL|MMC_DBG_CMD;//set the value refer to file rk_sdmmc_of.h -char dbg_flag[]="mmc0mmc1mmc2"; - -#if DW_MMC_OF_PROBE -static void rockchip_mmc_of_dump(struct rk_sdmmc_of *rk_mmc_property) -{ - printk("=========rockchip mmc dts dump info start== 2014-03-14 20:39 ======"); - mmc_debug(MMC_DBG_BOOT,"mmc,caps: 0x%x\n",rk_mmc_property->mmc_caps); - mmc_debug(MMC_DBG_BOOT,"mmc,ocr: 0x%x\n",rk_mmc_property->mmc_ocr); - mmc_debug(MMC_DBG_BOOT,"mmc,int: 0x%x\n",rk_mmc_property->mmc_int_type); - mmc_debug(MMC_DBG_BOOT,"mmc,emmc_is_selected: 0x%x\n",rk_mmc_property->emmc_is_selected); - mmc_debug(MMC_DBG_BOOT,"mmc,use_dma: %d %d\n",rk_mmc_property->mmc_dma_is_used[0], - rk_mmc_property->mmc_dma_is_used[1]); - mmc_debug(MMC_DBG_BOOT,"mmc,dma_ch: %d\n",rk_mmc_property->mmc_dma_chn); - mmc_debug(MMC_DBG_BOOT,"=========rockchip mmc dts dump info end================\n"); -} - - -void rockchip_mmc_of_probe(struct device_node *np,struct rk_sdmmc_of *rk_mmc_property) -{ - of_property_read_u32(np, "mmc,caps", &rk_mmc_property->mmc_caps); - of_property_read_u32(np, "mmc,ocr", &rk_mmc_property->mmc_ocr); - of_property_read_u32(np, "mmc,int", &rk_mmc_property->mmc_int_type); - of_property_read_u32(np, "mmc,emmc_is_selected", &rk_mmc_property->emmc_is_selected); - of_property_read_u32_array(np, "mmc,use_dma", rk_mmc_property->mmc_dma_is_used,2); -/* - if((&rk_mmc_property->mmc_dma_is_used[0] == MMC_USE_DMA)) - { - if(rk_mmc_property->mmc_dma_is_used[1] == 0) - rk_mmc_property->mmc_dma_name = "dma_mmc0"; - else if(rk_mmc_property->mmc_dma_is_used[1] == 1) - rk_mmc_property->mmc_dma_name = "dma_mmc1"; - else - rk_mmc_property->mmc_dma_name = "dma_mmc2"; - - //of_property_read_string(np, "mmc,dma_name", &(rk_mmc_property->mmc_dma_name)); - of_property_read_u32(np, "mmc,dma_ch", &rk_mmc_property->mmc_dma_chn); - - }else{ - mmc_debug(MMC_DBG_WARN,"Device Tree configure mmc drivers to use pio!\n"); - } - */ - rockchip_mmc_of_dump(rk_mmc_property); - return ; - -} -EXPORT_SYSMBOL(rockchip_mmc_of_probe); -#endif /*DW_MMC_OF_PROBE*/ - - diff --git a/drivers/mmc/host/rk_sdmmc_of.h b/drivers/mmc/host/rk_sdmmc_of.h deleted file mode 100755 index c18609b0e806..000000000000 --- a/drivers/mmc/host/rk_sdmmc_of.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Synopsys DesignWare Multimedia Card Interface driver - * - * Copyright (C) 2014 Fuzhou Rockchip Electronics Co.Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef __RK_SDMMC_OF_H -#define __RK_SDMMC_OF_H - -#include -#include -#include -#include - - -#define DRIVER_NAME "rk_sdmmc" -#define DRIVER_PREFIX DRIVER_NAME ": " -#define DRIVER_VER "Dw-mci-rockchip" -#define DW_MMC_OF_PROBE 0 - -enum MMC_DBG_MASK{ - MMC_DBG_NONE = 0, - MMC_DBG_BOOT = BIT(0), - MMC_DBG_ERROR= BIT(1), - MMC_DBG_WARN = BIT(2), - MMC_DBG_INFO = BIT(3), - MMC_DBG_CMD = BIT(4), - MMC_DBG_DBG = BIT(5), - MMC_DBG_SW_VOL = BIT(6), - MMC_DBG_ALL = 0xFF, - -}; - -extern u32 mmc_debug_level; -extern char dbg_flag[]; - -#define MMC_DBG_FUNC_CONFIG 1 -#if MMC_DBG_FUNC_CONFIG -#define MMC_DBG_BOOT_FUNC(mmc_host,fmt, arg...) \ - do { \ - if(mmc_debug_level & MMC_DBG_BOOT) { \ - if(NULL != strpbrk(dbg_flag,mmc_hostname(mmc_host))) { \ - printk(DRIVER_PREFIX "BOOT " fmt "\n", ##arg);\ - } \ - } \ - }while(0) -#define MMC_DBG_ERR_FUNC(mmc_host,fmt, arg...) \ - do{ \ - if(mmc_debug_level & MMC_DBG_ERROR) { \ - if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \ - printk(DRIVER_PREFIX "ERROR " fmt "\n", ##arg);\ - } \ - } \ - }while(0) -#define MMC_DBG_WARN_FUNC(mmc_host,fmt, arg...) \ - do { \ - if(mmc_debug_level & MMC_DBG_WARN) { \ - if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \ - printk(DRIVER_PREFIX "WARN " fmt "\n", ##arg);\ - } \ - } \ - }while(0) -#define MMC_DBG_INFO_FUNC(mmc_host,fmt, arg...) \ - do { \ - if(mmc_debug_level & MMC_DBG_INFO) { \ - if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \ - printk(DRIVER_PREFIX "INFO " fmt "\n", ##arg);\ - } \ - } \ - }while(0) -#define MMC_DBG_CMD_FUNC(mmc_host,fmt, arg...) \ - do { \ - if(mmc_debug_level & MMC_DBG_CMD) { \ - if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \ - printk(DRIVER_PREFIX "CMD " fmt "\n", ##arg);\ - } \ - } \ - }while(0) -#define MMC_DBG_SW_VOL_FUNC(mmc_host,fmt, arg...) \ - do { \ - if(mmc_debug_level & MMC_DBG_SW_VOL) { \ - if(strstr(dbg_flag,mmc_hostname(mmc_host))) { \ - printk(DRIVER_PREFIX "SW-VOL " fmt "\n", ##arg);\ - } \ - } \ - }while(0) -#else -#define MMC_DBG_BOOT_FUNC(mmc_host,fmt, arg...) {printk(DRIVER_PREFIX "BOOT " fmt "\n", ##arg);} -#define MMC_DBG_ERR_FUNC(mmc_host,fmt, arg...) -#define MMC_DBG_WARN_FUNC(mmc_host,fmt, arg...) -#define MMC_DBG_INFO_FUNC(mmc_host,fmt, arg...) -#define MMC_DBG_CMD_FUNC(mmc_host,fmt, arg...) -#define MMC_DBG_SW_VOL_FUNC(mmc_host,fmt, arg...) -#endif - -#if defined(CONFIG_DYNAMIC_DEBUG) - #define mmc_debug(level, fmt, arg...) \ - do { \ - if (unlikely(level & mmc_debug_level)) \ - dynamic_pr_debug(DRIVER_PREFIX fmt "\n", ##arg); \ - } while (0) -#else - #define mmc_debug(level, fmt, arg...) \ - do { \ - if (unlikely(level & mmc_debug_level)) \ - printk(KERN_DEBUG pr_fmt(DRIVER_PREFIX fmt "\n"), \ - ##arg); \ - } while (0) -#endif - -#if DW_MMC_OF_PROBE -struct rk_sdmmc_of -{ - u32 mmc_caps; - u32 mmc_int_type; - u32 mmc_ocr; - u32 mmc_dma_is_used[2]; /*Bit 1: use dma or not ; Bit 2:general dma or idma*/ - u32 emmc_is_selected; - u32 mmc_dma_chn; - const char *mmc_dma_name; - -}; -#endif /*DW_MMC_OF_PROBE*/ - -#endif