[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <504FB8BA.1010703@wwwdotorg.org>
Date: Tue, 11 Sep 2012 16:18:34 -0600
From: Stephen Warren <swarren@...dotorg.org>
To: Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>
CC: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
Grant Likely <grant.likely@...retlab.ca>,
Rob Herring <rob.herring@...xeda.com>,
Rob Landley <rob@...dley.net>,
Russell King <linux@....linux.org.uk>,
Lior Amsalem <alior@...vell.com>, Andrew Lunn <andrew@...n.ch>,
Jason Cooper <jason@...edaemon.net>,
Gregory CLEMENT <gregory.clement@...e-electrons.com>,
Ben Dooks <ben.dooks@...ethink.co.uk>,
Linus Walleij <linus.walleij@...aro.org>,
devicetree-discuss@...ts.ozlabs.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3 2/9] pinctrl: mvebu: dove pinctrl driver
On 09/10/2012 02:39 AM, Sebastian Hesselbarth wrote:
> This patch adds a SoC specific pinctrl driver for Marvell Dove SoCs
> plus DT binding documentation. This driver will use the mvebu pinctrl
> driver core.
> diff --git a/drivers/pinctrl/pinctrl-dove.c b/drivers/pinctrl/pinctrl-dove.c
> +static int dove_mpp4_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
> + unsigned long *config)
> +{
> + unsigned long mpp4 = readl(DOVE_MPP_CTRL4_VIRT_BASE);
> + unsigned long mask;
> +
> + switch (ctrl->pid) {
> + case 24: /* mpp_camera */
> + mask = DOVE_CAM_GPIO_SEL;
> + break;
> + case 40: /* mpp_sdio0 */
> + mask = DOVE_SD0_GPIO_SEL;
> + break;
> + case 46: /* mpp_sdio1 */
> + mask = DOVE_SD1_GPIO_SEL;
> + break;
> + case 58: /* mpp_spi0 */
> + mask = DOVE_SPI_GPIO_SEL;
> + break;
> + case 62: /* mpp_uart1 */
> + mask = DOVE_UART1_GPIO_SEL;
> + break;
> + default:
> + return -EINVAL;
> + }
Wouldn't it be better to use #defines instead of the constants in the
case statements, and also share those #defines with:
> +static struct mvebu_mpp_ctrl dove_mpp_controls[] = {
> + MPP_FUNC_CTRL(0, 0, "mpp0", dove_pmu_mpp_ctrl),
^^^^
> +static struct mvebu_mpp_mode dove_mpp_modes[] = {
> + MPP_MODE(0,
^^
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists