Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294069
b: refs/heads/master
c: 03665e0
h: refs/heads/master
i:
  294067: 02b3a79
v: v3
  • Loading branch information
Stephen Warren authored and Linus Walleij committed Feb 22, 2012
1 parent 466df89 commit b9ba799
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b2b3e66e40bb60b1aa222d2f712c019653215390
refs/heads/master: 03665e0f248d6b7542f72cd7c4ec521109f283c7
56 changes: 28 additions & 28 deletions trunk/drivers/pinctrl/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,34 @@ struct pinmux_group {
unsigned group_selector;
};

int pinmux_check_ops(struct pinctrl_dev *pctldev)
{
const struct pinmux_ops *ops = pctldev->desc->pmxops;
unsigned selector = 0;

/* Check that we implement required operations */
if (!ops->list_functions ||
!ops->get_function_name ||
!ops->get_function_groups ||
!ops->enable ||
!ops->disable)
return -EINVAL;

/* Check that all functions registered have names */
while (ops->list_functions(pctldev, selector) >= 0) {
const char *fname = ops->get_function_name(pctldev,
selector);
if (!fname) {
pr_err("pinmux ops has no name for function%u\n",
selector);
return -EINVAL;
}
selector++;
}

return 0;
}

/**
* pin_request() - request a single pin to be muxed in, typically for GPIO
* @pin: the pin number in the global pin space
Expand Down Expand Up @@ -561,34 +589,6 @@ void pinmux_disable(struct pinctrl *p)
}
}

int pinmux_check_ops(struct pinctrl_dev *pctldev)
{
const struct pinmux_ops *ops = pctldev->desc->pmxops;
unsigned selector = 0;

/* Check that we implement required operations */
if (!ops->list_functions ||
!ops->get_function_name ||
!ops->get_function_groups ||
!ops->enable ||
!ops->disable)
return -EINVAL;

/* Check that all functions registered have names */
while (ops->list_functions(pctldev, selector) >= 0) {
const char *fname = ops->get_function_name(pctldev,
selector);
if (!fname) {
pr_err("pinmux ops has no name for function%u\n",
selector);
return -EINVAL;
}
selector++;
}

return 0;
}

#ifdef CONFIG_DEBUG_FS

/* Called from pincontrol core */
Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/pinctrl/pinmux.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#ifdef CONFIG_PINMUX

int pinmux_check_ops(struct pinctrl_dev *pctldev);
void pinmux_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev);
int pinmux_request_gpio(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned pin, unsigned gpio);
Expand All @@ -36,6 +34,8 @@ int pinmux_apply_muxmap(struct pinctrl_dev *pctldev,
void pinmux_put(struct pinctrl *p);
int pinmux_enable(struct pinctrl *p);
void pinmux_disable(struct pinctrl *p);
void pinmux_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev);
void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p);

#else
Expand All @@ -45,11 +45,6 @@ static inline int pinmux_check_ops(struct pinctrl_dev *pctldev)
return 0;
}

static inline void pinmux_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev)
{
}

static inline int pinmux_request_gpio(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned pin, unsigned gpio)
Expand Down Expand Up @@ -95,7 +90,12 @@ static inline void pinmux_disable(struct pinctrl *p)
{
}

void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p)
static inline void pinmux_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev)
{
}

static inline void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p)
{
}

Expand Down

0 comments on commit b9ba799

Please sign in to comment.