Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372523
b: refs/heads/master
c: 380c2ed
h: refs/heads/master
i:
  372521: c14f745
  372519: 00a81a6
v: v3
  • Loading branch information
Laurent Pinchart committed Mar 15, 2013
1 parent 6bb35cc commit 296d3fc
Show file tree
Hide file tree
Showing 3 changed files with 16 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: 53f374b13413c072ec4717703479ef7d5b632f90
refs/heads/master: 380c2ed92412d519c71d8c270d6b073b2c5bfdec
19 changes: 2 additions & 17 deletions trunk/drivers/pinctrl/sh-pfc/pinctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,22 +315,6 @@ static const struct pinconf_ops sh_pfc_pinconf_ops = {
.pin_config_dbg_show = sh_pfc_pinconf_dbg_show,
};

static void sh_pfc_map_one_gpio(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx,
struct pinmux_gpio *gpio, unsigned offset)
{
struct pinmux_data_reg *dummy;
int bit;

gpio->flags &= ~PINMUX_FLAG_TYPE;

if (sh_pfc_get_data_reg(pfc, offset, &dummy, &bit) == 0)
gpio->flags |= PINMUX_TYPE_GPIO;
else {
gpio->flags |= PINMUX_TYPE_FUNCTION;
pmx->nr_functions++;
}
}

/* pinmux ranges -> pinctrl pin descs */
static int sh_pfc_map_gpios(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
{
Expand All @@ -356,7 +340,8 @@ static int sh_pfc_map_gpios(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
if (unlikely(!gpio->enum_id))
continue;

sh_pfc_map_one_gpio(pfc, pmx, gpio, i);
if ((gpio->flags & PINMUX_FLAG_TYPE) == PINMUX_TYPE_FUNCTION)
pmx->nr_functions++;
}

return 0;
Expand Down
16 changes: 13 additions & 3 deletions trunk/drivers/pinctrl/sh-pfc/sh_pfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,18 @@ struct pinmux_gpio {
const char *name;
};

#define PINMUX_GPIO(gpio, data_or_mark) \
[gpio] = { .name = __stringify(gpio), .enum_id = data_or_mark, .flags = PINMUX_TYPE_NONE }
#define PINMUX_GPIO(gpio, data_or_mark) \
[gpio] = { \
.name = __stringify(gpio), \
.enum_id = data_or_mark, \
.flags = PINMUX_TYPE_GPIO \
}
#define PINMUX_GPIO_FN(gpio, data_or_mark) \
[gpio] = { \
.name = __stringify(gpio), \
.enum_id = data_or_mark, \
.flags = PINMUX_TYPE_FUNCTION \
}

#define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0

Expand Down Expand Up @@ -135,7 +145,7 @@ enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE };
#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
#define PORT_ALL(str) CPU_ALL_PORT(_PORT_ALL, PORT, str)
#define GPIO_PORT_ALL() CPU_ALL_PORT(_GPIO_PORT, , unused)
#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
#define GPIO_FN(str) PINMUX_GPIO_FN(GPIO_FN_##str, str##_MARK)

/* helper macro for pinmux_enum_t */
#define PORT_DATA_I(nr) \
Expand Down

0 comments on commit 296d3fc

Please sign in to comment.