Received: by 10.223.185.116 with SMTP id b49csp6512779wrg; Wed, 28 Feb 2018 10:38:30 -0800 (PST) X-Google-Smtp-Source: AH8x227Kf1DqP2L5qfbmoZfGvK+FBCF5EIHfsNmX9S0Ogk8YuWpGXIQaNgYePyiLw+B5MnougbSG X-Received: by 10.101.90.140 with SMTP id c12mr13721859pgt.56.1519843110312; Wed, 28 Feb 2018 10:38:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519843110; cv=none; d=google.com; s=arc-20160816; b=s9hdjiZGSS8YdskvVUfubwlHfscnxk662uH4suYfRDyQiLMUWSh34RN3LW9V/RiG3w gDjCUQJAsdlgBTNC9BqEOBIjU70ctXTYKh0MxyaGOnXdg7FzEtoElDPPAKjTAMxCxODR CMw1sFMlREVgpuvDSLpN6BPktjyVWOd9M4/m0PlIrt+jgQsU6wwuTsUOgviEET2JGRXj qf49pZVW4zyqzXkGIrr43zvXjKjAg5NPjRtnIR1Lvwm3O/z52CZmleYqpQiA+m40pUiM 9CwrWiWXCsotfb3bErIMOptg31/XZkPgmWLwkHTzok/s0NlrHqb7ZQHPbh8IxmM9xFdZ eLbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=KDpmw7gedjcHqB5ARKKWqoBundw05fDw+wCaboJzo5g=; b=D5KrHroMysGISC5gS4UXdgAxoriLnm//NxXUSXjNZmIpZThu4K/0j232r/0q1ZxwLn 9e6lGLPfm1Dbkv8sgSeL7CzJbp0KcpxKkOtygQka9FYCHg8N/YX11Oida8wVYQoKU4kV jRkdBenGlO6NfCQQhKFqZVyTGci9QOPPRSq+2X3GPTHomJsBdu6DJ2qlbMz2D+qzEbSO aG80ORUwB0fnvZxisZK6Fhc+CPqThqnGvZblmzmRYovZpE28P6vzs73MUfQTlMGYDXYL Htb6O+ko82r8ti12ujpj0EB1Ugu77jRsI1gfQjvi0dHSuc6MVsqTZPVzv538An54ep2B F2Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a6ZGsFyZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f84si1591920pfe.128.2018.02.28.10.38.14; Wed, 28 Feb 2018 10:38:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a6ZGsFyZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932494AbeB1Sg6 (ORCPT + 99 others); Wed, 28 Feb 2018 13:36:58 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:40499 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbeB1Sgz (ORCPT ); Wed, 28 Feb 2018 13:36:55 -0500 Received: by mail-qk0-f195.google.com with SMTP id o25so4246843qkl.7; Wed, 28 Feb 2018 10:36:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KDpmw7gedjcHqB5ARKKWqoBundw05fDw+wCaboJzo5g=; b=a6ZGsFyZdQ1pimQPL2uXJm/h4wW0Uu52e8Zy8ziUrDBygyu/47kkomAhsJJ18cOgYq BgovQMtRR8E3YseIeZ/wYvZZBciH435sNE2lpdCHi/T5D1NyF6t9R3T1+PbhwM44uG+6 3Un8j3MqnHjwEe7TxLHFwZeHIDul90pHx1QpS7qWLrhfCMizhqizEBm/MO3d8gilSTEy 9VgJ5kwfztprD9MkRZQdQOutwR4GYwY7rF3XgMcuo8WkEUzrGDPzGNfrKwdPAi8OLOsY BV0DR7O1BCcjkI33s7ekMTaHTQ17Tn9UC15eqGVl7HWDlhj+y0EXESCSQnf/Q87XtmSt pFkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KDpmw7gedjcHqB5ARKKWqoBundw05fDw+wCaboJzo5g=; b=C7OWR8hyaZ+L+5XmVH8VURr2f4rKLRh+eUNA/fwfyz3eJmjV1QSXWGhpfHzYfUug0L OQAGOMazquejvuBP0SsfZs+kizCaxB3CTUFT8Iwb91qYOuTRSUi5XtD++tHpi5Ii+akS xNrgFTicafmJgr+Ik0YyzUPalwdCi6eEt6J+31GAv1A7mxZ+IGiXFVbC74GP07ks096m VZk/JQe4Weka5WXZW0GzpMR5Vwen0QlzznbYrzqnxfuuEYSeVvq53WUVvueBTDY8HLW+ XkopCOxevMTL8JjdzW9FkiIjYUb3Lc42XME8p9TAR6w+pJMw04YXEPNPotuvhFzn/vHq QK3g== X-Gm-Message-State: APf1xPDshNADutWog9ktHzviN0jWBUNDYscKReIqO/UlYLSjTme/Cauw baYue0xeLrd4wMEKhOsdXPbfvsPJ7rPrQSXYRAU= X-Received: by 10.55.123.197 with SMTP id w188mr15656482qkc.70.1519843014423; Wed, 28 Feb 2018 10:36:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.195.80 with HTTP; Wed, 28 Feb 2018 10:36:53 -0800 (PST) In-Reply-To: <20180228181432.26847-5-manivannan.sadhasivam@linaro.org> References: <20180228181432.26847-1-manivannan.sadhasivam@linaro.org> <20180228181432.26847-5-manivannan.sadhasivam@linaro.org> From: Andy Shevchenko Date: Wed, 28 Feb 2018 20:36:53 +0200 Message-ID: Subject: Re: [PATCH v3 04/10] pinctrl: actions: Add Actions S900 pinctrl driver To: Manivannan Sadhasivam Cc: Linus Walleij , Rob Herring , =?UTF-8?Q?Andreas_F=C3=A4rber?= , =?UTF-8?B?5YiY54Kc?= , mp-cs@actions-semi.com, 96boards@ucrobotics.com, devicetree , Daniel Thompson , amit.kucheria@linaro.org, linux-arm Mailing List , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , hzhang@ucrobotics.com, bdong@ucrobotics.com, manivannanece23@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 28, 2018 at 8:14 PM, Manivannan Sadhasivam wrote: > Add pinctrl driver for Actions Semi S900 SoC. The driver supports > pinctrl, pinmux and pinconf functionalities through a range of registers > common to both gpio driver and pinctrl driver. > > Pinmux functionality is available only for the pin groups while the > pinconf functionality is available for both pin groups and individual > pins. > +static int owl_set_mux(struct pinctrl_dev *pctrldev, > + unsigned int function, > + unsigned int group) > +{ > + mfpval = readl(pctrl->base + g->mfpctl_reg); > + mfpval &= ~mask; > + mfpval |= val; > + writel(mfpval, pctrl->base + g->mfpctl_reg); This is called owl_update_bits(). > +static int owl_pin_config_set(struct pinctrl_dev *pctrldev, > + unsigned int pin, > + unsigned long *configs, > + unsigned int num_configs) > +{ > + int ret = 0; Redundant assignment? > + mask = (1 << width) - 1; > + mask = mask << bit; > + tmp = readl(pctrl->base + reg); > + tmp &= ~mask; > + tmp |= arg << bit; > + writel(tmp, pctrl->base + reg); This is called owl_update_bits(). > +} > +static int owl_group_pinconf_val2arg(const struct owl_pingroup *g, > + unsigned int param, > + u32 *arg) > +{ > + case PIN_CONFIG_SLEW_RATE: > + if (*arg) > + *arg = 1; > + else > + *arg = 0; Doesn't slew rate allow a non-binary value? > + return 0; > +} > + > +static int owl_group_config_get(struct pinctrl_dev *pctrldev, > + unsigned int group, > + unsigned long *config) > +{ > + int ret = 0; Redundant assignment. > +} > +static int owl_group_config_set(struct pinctrl_dev *pctrldev, > + unsigned int group, > + unsigned long *configs, > + unsigned int num_configs) > +{ > + int ret = 0; Redundant assignment, see below. > + mask = (1 << width) - 1; > + mask = mask << bit; > + tmp = readl(pctrl->base + reg); > + tmp &= ~mask; > + tmp |= arg << bit; > + writel(tmp, pctrl->base + reg); This is called owl_update_bits(). > + return ret; return 0; ? > +} > +int owl_pinctrl_probe(struct platform_device *pdev, > + struct owl_pinctrl_soc_data *soc_data) > +{ > + clk_prepare_enable(pctrl->clk); This can fail. > +} > +static const struct of_device_id s900_pinctrl_of_match[] = { > + { .compatible = "actions,s900-pinctrl", }, > + { }, No comma needed. > +}; -- With Best Regards, Andy Shevchenko