Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294070
b: refs/heads/master
c: 2b69425
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Warren authored and Linus Walleij committed Feb 22, 2012
1 parent b9ba799 commit 9fade57
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 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: 03665e0f248d6b7542f72cd7c4ec521109f283c7
refs/heads/master: 2b694250174980382bddcb00e1de7654ecdf6f1f
31 changes: 15 additions & 16 deletions trunk/drivers/pinctrl/pinconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,20 @@
#include "core.h"
#include "pinconf.h"

int pin_config_get_for_pin(struct pinctrl_dev *pctldev, unsigned pin,
int pinconf_check_ops(struct pinctrl_dev *pctldev)
{
const struct pinconf_ops *ops = pctldev->desc->confops;

/* We must be able to read out pin status */
if (!ops->pin_config_get && !ops->pin_config_group_get)
return -EINVAL;
/* We have to be able to config the pins in SOME way */
if (!ops->pin_config_set && !ops->pin_config_group_set)
return -EINVAL;
return 0;
}

static int pin_config_get_for_pin(struct pinctrl_dev *pctldev, unsigned pin,
unsigned long *config)
{
const struct pinconf_ops *ops = pctldev->desc->confops;
Expand Down Expand Up @@ -63,7 +76,7 @@ int pin_config_get(const char *dev_name, const char *name,
}
EXPORT_SYMBOL(pin_config_get);

int pin_config_set_for_pin(struct pinctrl_dev *pctldev, unsigned pin,
static int pin_config_set_for_pin(struct pinctrl_dev *pctldev, unsigned pin,
unsigned long config)
{
const struct pinconf_ops *ops = pctldev->desc->confops;
Expand Down Expand Up @@ -138,7 +151,6 @@ int pin_config_group_get(const char *dev_name, const char *pin_group,
}
EXPORT_SYMBOL(pin_config_group_get);


int pin_config_group_set(const char *dev_name, const char *pin_group,
unsigned long config)
{
Expand Down Expand Up @@ -205,19 +217,6 @@ int pin_config_group_set(const char *dev_name, const char *pin_group,
}
EXPORT_SYMBOL(pin_config_group_set);

int pinconf_check_ops(struct pinctrl_dev *pctldev)
{
const struct pinconf_ops *ops = pctldev->desc->confops;

/* We must be able to read out pin status */
if (!ops->pin_config_get && !ops->pin_config_group_get)
return -EINVAL;
/* We have to be able to config the pins in SOME way */
if (!ops->pin_config_set && !ops->pin_config_group_set)
return -EINVAL;
return 0;
}

#ifdef CONFIG_DEBUG_FS

static void pinconf_dump_pin(struct pinctrl_dev *pctldev,
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/pinctrl/pinconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
#ifdef CONFIG_PINCONF

int pinconf_check_ops(struct pinctrl_dev *pctldev);

void pinconf_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev);
int pin_config_get_for_pin(struct pinctrl_dev *pctldev, unsigned pin,
unsigned long *config);
int pin_config_set_for_pin(struct pinctrl_dev *pctldev, unsigned pin,
unsigned long config);

#else

Expand Down

0 comments on commit 9fade57

Please sign in to comment.