Re: [PATCH 1/4 v4] drivers: create a pin control subsystem

From: Barry Song
Date: Wed Aug 24 2011 - 02:24:59 EST


> +int foo_list(struct pinmux_dev *pmxdev, unsigned selector)

pinctrl_dev?

> +{
> + Â Â Â if (selector >= ARRAY_SIZE(myfuncs))
> + Â Â Â Â Â Â Â return -EINVAL;
> + Â Â Â return 0;
> +}
> +
> +const char *foo_get_fname(struct pinmux_dev *pmxdev, unsigned selector)

pinctrl_dev?

> +{
> + Â Â Â if (selector >= ARRAY_SIZE(myfuncs))
> + Â Â Â Â Â Â Â return NULL;
> + Â Â Â return myfuncs[selector].name;
> +}
> +
> +static int foo_get_pins(struct pinmux_dev *pmxdev, unsigned selector,
> + Â Â Â Â Â Â Â Â Â Â Â unsigned ** const pins, unsigned * const num_pins)

pinctrl_dev?

> +{
> + Â Â Â if (selector >= ARRAY_SIZE(myfuncs))
> + Â Â Â Â Â Â Â return -EINVAL;
> + Â Â Â *pins = myfuncs[selector].pins;
> + Â Â Â *num_pins = myfuncs[selector].num_pins;
> + Â Â Â return 0;
> +}
> +
> +int foo_enable(struct pinmux_dev *pmxdev, unsigned selector)
> +{
> + Â Â Â if (selector < ARRAY_SIZE(myfuncs))
> + Â Â Â Â Â Â Â write((read(MUX)|(1<<selector)), MUX)
> + Â Â Â Â Â Â Â return 0;
> + Â Â Â }
> + Â Â Â return -EINVAL;
> +}
> +
> +int foo_disable(struct pinmux_dev *pmxdev, unsigned selector)

pinctrl_dev?

-barry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/