#if 1
-#define DBG_PINCTRL(x...) if((((atomic_read(&info->bank_debug_flag) == (bank->bank_num + 1)) && (atomic_read(&info->pin_debug_flag) == (pin + 1))) || ((atomic_read(&info->pin_debug_flag) == 0) && (atomic_read(&info->bank_debug_flag) == (bank->bank_num + 1)))) && bank && info) printk(x)
+#define DBG_PINCTRL(x...) do { if((((atomic_read(&info->bank_debug_flag) == (bank->bank_num + 1)) && (atomic_read(&info->pin_debug_flag) == (pin + 1))) || ((atomic_read(&info->pin_debug_flag) == 0) && (atomic_read(&info->bank_debug_flag) == (bank->bank_num + 1)))) && bank && info) printk(x); } while (0)
#else
#define DBG_PINCTRL(x...)
#endif
{
struct rockchip_pinctrl *info;
char *buf;
- u32 len = 0;
ssize_t ret;
- int reg = 0;
int bank_value, pin_value;
info = file->private_data;
if((bank_value < 0))
{
- printk("%s:error:bank is out of range %d\n",__func__, bank_value,info->ctrl->nr_banks-1);
+ printk("%s:error:bank%d is out of range %d\n",__func__, bank_value,info->ctrl->nr_banks-1);
}
else
{
return 0;
}
+#if 0
static void pinctrl_debugfs_remove(struct rockchip_pinctrl*info)
{
if (info->debugfs)
debugfs_remove_recursive(info->debugfs);
}
+#endif
#else
static inline int pinctrl_debugfs_init(struct rockchip_pinctrl*info)
return 0;
}
+#if 0
static inline void pinctrl_debugfs_remove(struct rockchip_pinctrl*info)
{
}
+#endif
#endif /* CONFIG_DEBUG_FS */
u8 bit;
unsigned long flags;
struct rockchip_pinctrl *info = bank->drvdata;
- void __iomem *reg0 = reg;
if(bits == 2)
{
{
struct rockchip_pinctrl *info = bank->drvdata;
void __iomem *reg = info->reg_mux;
- unsigned long flags;
- u8 bit;
- u32 data;
struct union_mode m;
u8 bits = 0;
return 0;
}
+#if 0
static void rockchip_pmx_disable(struct pinctrl_dev *pctldev,
unsigned selector, unsigned group)
{
rockchip_set_mux(bank, pins[cnt] - bank->pin_base, FUNC_TO_GPIO(data[cnt].func));
}
}
+#endif
/*
* The calls to gpio_direction_output() and gpio_direction_input()
}
-
+#if 0
static int rockchip_get_pull(struct rockchip_pin_bank *bank, int pin_num)
{
struct rockchip_pinctrl *info = bank->drvdata;
DBG_PINCTRL("%s:GPIO%d-%d pull is 0x%x\n", __func__, bank->bank_num, pin_num, data);
}
+#endif
static int rockchip_set_pull(struct rockchip_pin_bank *bank,
int pin_num, int pull)
return false;
}
+#if 0
static int _rockchip_pinconf_get(struct rockchip_pin_bank *bank,
int pin_num, unsigned long *config, int config_type, unsigned group)
{
return 0;
}
-
+#endif
static int _rockchip_pinconf_set(struct rockchip_pin_bank *bank,
return 0;
}
+#if 0
/* get the pin config settings for a specified pin */
static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *config, unsigned group)
return 0;
}
+#endif
/* set the pin config settings for a specified pin group */
static int rockchip_pinconf_group_set(struct pinctrl_dev *pctldev,
struct rockchip_pinctrl *info = g_info;
struct rockchip_pin_ctrl *ctrl = info->ctrl;
struct rockchip_pin_bank *bank = ctrl->pin_banks;
- int n, i = 0;
+ int n;
//int value = 0;
for(n=0; n<ctrl->nr_banks-1; n++)
{
#if 0
+ int i;
for(i=0; i<0x60; i=i+4)
{
value = readl_relaxed(bank->reg_base + i);
struct rockchip_pinctrl *info = g_info;
struct rockchip_pin_ctrl *ctrl = info->ctrl;
struct rockchip_pin_bank *bank = ctrl->pin_banks;
- int n, i = 0;
- int value = 0;
+ int n;
u32 isr;
for(n=0; n<ctrl->nr_banks-1; n++)
{
#if 0
+ int i;
for(i=0; i<0x60; i=i+4)
{
- value = readl_relaxed(bank->reg_base + i);
+ u32 value = readl_relaxed(bank->reg_base + i);
printk("%s:bank_num=%d,reg[0x%x+0x%x]=0x%x,bank_name=%s\n",__func__,bank->bank_num, bank->reg_base, i, value, bank->name);
}
#endif
of_get_gpio_init_config(struct device *dev, struct device_node *np)
{
struct gpio_init_config *config;
- struct property *prop;
- const char *regtype;
- int proplen, gpio, i;
+ int gpio, i;
enum of_gpio_flags flags;
config = devm_kzalloc(dev,
config->gpios[i].gpio = gpio;
config->gpios[i].flags = flags & OF_GPIO_ACTIVE_LOW;
- printk("%s:gpio[%d] = %d, value = %d\n",__func__, i, gpio, config->gpios[i].flags);
+ printk("%s:gpio[%d] = %d, value = %lu\n",__func__, i, gpio, config->gpios[i].flags);
}
return config;
break;
- defualt:
+ default:
printk("%s:unknown chip type %d\n",__func__, (int)ctrl->type);
return -1;