Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031246AbbD1W41 (ORCPT ); Tue, 28 Apr 2015 18:56:27 -0400 Received: from mail-qk0-f174.google.com ([209.85.220.174]:35532 "EHLO mail-qk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030966AbbD1W4Z (ORCPT ); Tue, 28 Apr 2015 18:56:25 -0400 MIME-Version: 1.0 In-Reply-To: <55400C75.9070609@imgtec.com> References: <1428435862-14354-1-git-send-email-abrestic@chromium.org> <1428435862-14354-3-git-send-email-abrestic@chromium.org> <55400C75.9070609@imgtec.com> Date: Tue, 28 Apr 2015 15:56:24 -0700 X-Google-Sender-Auth: oe95N_MKcCAfWT4d3FQhCmgvLi8 Message-ID: Subject: Re: [PATCH V3 2/2] pinctrl: Add Pistachio SoC pin control driver From: Andrew Bresticker To: Ezequiel Garcia Cc: Linus Walleij , Alexandre Courbot , Ralf Baechle , "devicetree@vger.kernel.org" , "linux-gpio@vger.kernel.org" , Linux-MIPS , "linux-kernel@vger.kernel.org" , James Hartley , James Hogan , Damien Horsley , Govindraj Raja , Kevin Cernekee , Paul Bolle Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3623 Lines: 87 On Tue, Apr 28, 2015 at 3:40 PM, Ezequiel Garcia wrote: > Just a silly comment. > > On 04/07/2015 04:44 PM, Andrew Bresticker wrote: > [..] >> + >> +static const struct pinmux_ops pistachio_pinmux_ops = { >> + .get_functions_count = pistachio_pinmux_get_functions_count, >> + .get_function_name = pistachio_pinmux_get_function_name, >> + .get_function_groups = pistachio_pinmux_get_function_groups, >> + .set_mux = pistachio_pinmux_enable, >> +}; >> + >> +static int pistachio_pinconf_get(struct pinctrl_dev *pctldev, unsigned pin, >> + unsigned long *config) >> +{ >> + struct pistachio_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); >> + enum pin_config_param param = pinconf_to_config_param(*config); >> + u32 val, arg; >> + >> + switch (param) { >> + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: >> + val = pctl_readl(pctl, PADS_SCHMITT_EN_REG(pin)); >> + arg = !!(val & PADS_SCHMITT_EN_BIT(pin)); >> + break; >> + case PIN_CONFIG_BIAS_HIGH_IMPEDANCE: >> + val = pctl_readl(pctl, PADS_PU_PD_REG(pin)) >> >> + PADS_PU_PD_SHIFT(pin); >> + arg = (val & PADS_PU_PD_MASK) == PADS_PU_PD_HIGHZ; >> + break; >> + case PIN_CONFIG_BIAS_PULL_UP: >> + val = pctl_readl(pctl, PADS_PU_PD_REG(pin)) >> >> + PADS_PU_PD_SHIFT(pin); >> + arg = (val & PADS_PU_PD_MASK) == PADS_PU_PD_UP; >> + break; >> + case PIN_CONFIG_BIAS_PULL_DOWN: >> + val = pctl_readl(pctl, PADS_PU_PD_REG(pin)) >> >> + PADS_PU_PD_SHIFT(pin); >> + arg = (val & PADS_PU_PD_MASK) == PADS_PU_PD_DOWN; >> + break; >> + case PIN_CONFIG_BIAS_BUS_HOLD: >> + val = pctl_readl(pctl, PADS_PU_PD_REG(pin)) >> >> + PADS_PU_PD_SHIFT(pin); >> + arg = (val & PADS_PU_PD_MASK) == PADS_PU_PD_BUS; >> + break; >> + case PIN_CONFIG_SLEW_RATE: >> + val = pctl_readl(pctl, PADS_SLEW_RATE_REG(pin)); >> + arg = !!(val & PADS_SLEW_RATE_BIT(pin)); >> + break; >> + case PIN_CONFIG_DRIVE_STRENGTH: >> + val = pctl_readl(pctl, PADS_DRIVE_STRENGTH_REG(pin)) >> >> + PADS_DRIVE_STRENGTH_SHIFT(pin); >> + switch (val & PADS_DRIVE_STRENGTH_MASK) { >> + case PADS_DRIVE_STRENGTH_2MA: >> + arg = 2; >> + break; >> + case PADS_DRIVE_STRENGTH_4MA: >> + arg = 4; >> + break; >> + case PADS_DRIVE_STRENGTH_8MA: >> + arg = 8; >> + break; >> + case PADS_DRIVE_STRENGTH_12MA: >> + default: >> + arg = 12; >> + break; >> + } >> + break; >> + default: >> + dev_err(pctl->dev, "Property %u not supported\n", param); > > Probably just a nitpick, but maybe this should be dev_dbg. Otherwise, > we'll get a ton of these errors when cat'ing pinconf-pins in debugfs. > >> + return -EINVAL; > > And this should be -ENOTSUPP. I guess it doesn't matter much. Ah, you're right. I meant to this for V3 but I guess I forgot. Will fix. -Andrew -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/