Received: by 10.223.185.116 with SMTP id b49csp7695520wrg; Thu, 1 Mar 2018 09:31:10 -0800 (PST) X-Google-Smtp-Source: AG47ELuxG8rZKoe7j6m/wNW+8gJ6la7/hNjPmcUYz5fvxsjl/zOtsNxtZAWYdehdm1lNP5Tx6LvX X-Received: by 10.98.65.198 with SMTP id g67mr2687083pfd.127.1519925470591; Thu, 01 Mar 2018 09:31:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519925470; cv=none; d=google.com; s=arc-20160816; b=pF9+J0YnP64K7vAdb9Bh4Tv/Gno+RX4P9zX6UV42y6rC+hgNg3s18PFRKUMD+WtiDr Bv9kpOcWjuher/pJo/vBcJQe71Xmnxti37Pkj8lpw06PSjI1jfm+CkRAM0pN0ojyFZ74 /Imqx5jqMFKDEPo60NF4kbaBxs7OFfph/QAanOC3x33UYUpfLY/dtDu8ngawwxRiUSsW 6bxAWvaLK2FM2MjTgiVyHI6QSe6WZxcU047jfUzz9LUa2aO7W6r1KPm+cTYSMIS+Z0Ip 6yMHbwlmaci/EthcGo0AaUUIMswau0eTOn4DJOZFXWeHY37QLqtJM5ue8jqpVQ07p/1e btRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=39hv/cJQ5NExSDxVL8ImqvRdtF5KZWWeQ6QhD07ppro=; b=XYgiSuu4iaDbTZkC/r5FUEiU23VGhLDEprsuhz5vLhSx/8ewmIekrWCQEXFwpGnHm6 MUUaESrEWIbf6uDX9M/6YaYQRBcbTTL6maEeXeKThQhLIInHT10E3NSRGggPrFUP5PwN zCdBC25Xc94z39Cx4l53btd6nd98nMBuVbXARvTxCz/T/IlZ6nhNNnGBBJ0M+GghmenQ zMeVD8Z0uWrSBWdIGjv6ezhyuDqCuTbkWv2JPpSuWn4bd87AHkNHPdz7mCgPdkPgiCMD R9JdzU/3KCZ8efMtwDP8zo7cfojXm7qrWqPh6ERjcjFefMbhY3tnZvOvohlU2xX/lhCm C+7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JXI9bckR; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si3277129pfc.183.2018.03.01.09.30.55; Thu, 01 Mar 2018 09:31:10 -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=@linaro.org header.s=google header.b=JXI9bckR; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033492AbeCARaE (ORCPT + 99 others); Thu, 1 Mar 2018 12:30:04 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:37547 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033466AbeCAR3z (ORCPT ); Thu, 1 Mar 2018 12:29:55 -0500 Received: by mail-pl0-f66.google.com with SMTP id ay8-v6so4030432plb.4 for ; Thu, 01 Mar 2018 09:29:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=39hv/cJQ5NExSDxVL8ImqvRdtF5KZWWeQ6QhD07ppro=; b=JXI9bckRy60lXP2rn66g4olAmmlk0142sKlUbGDRj19VsFXU6En8eiEqhYR2e3cUCn uhg4tkwyIHw6ycYeWyNnGOULjoQPH+gn8VlSQDeRkueZCY+3+ed+DAr6c/XK0SggDpXa kuu+HwyFVwCASIW7WXS5pIZIlhTu8SpL+66aM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=39hv/cJQ5NExSDxVL8ImqvRdtF5KZWWeQ6QhD07ppro=; b=tRdwuvIM9eFiJnoQPOYT9Mzo92JLwCd0Igitc+MaOeEN1Urskzu3EB5PwvZuhaKULX LnpYaUo3NfnrW/VGYgrd0bvvHshkOpZyn6uCeJrUgsvz4KpqCa8X9/hKnWbfsoyAnnF/ MWkyPjTh2kVH//KpXo8/mrOV3xDnZxV65T2X8Vaznk/vDI4J4pZcAe1Egdr8Jl/XJe6h dpwb+zCOyX6wbAQSLhBMMMDy2B4QOlJBCihs5r/EUkZRGeuG7g6UiwAaNDbfePAOjzIT MhS6YbZMmnO/7JABUrskfKELYLfd++yC8/TbdIq1dS6iN/JHmW95oyRPKvq+4MXVr6Ch 8Omg== X-Gm-Message-State: APf1xPBSBannyr8OaY2u0XgpOkqD64PYO82dI+Ruh13Z6Y9QK4WbTABI vRXssjawzhGKYhrMUFRYnGzG X-Received: by 2002:a17:902:2904:: with SMTP id g4-v6mr2573100plb.170.1519925395033; Thu, 01 Mar 2018 09:29:55 -0800 (PST) Received: from linaro.org ([2405:204:70c6:1db7:ad8a:fea6:7d74:c9d2]) by smtp.gmail.com with ESMTPSA id c188sm6951449pga.14.2018.03.01.09.29.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Mar 2018 09:29:54 -0800 (PST) Date: Thu, 1 Mar 2018 22:59:44 +0530 From: Manivannan Sadhasivam To: Andy Shevchenko Cc: Linus Walleij , Rob Herring , Andreas =?iso-8859-1?Q?F=E4rber?= , =?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 Subject: Re: [PATCH v3 04/10] pinctrl: actions: Add Actions S900 pinctrl driver Message-ID: <20180301172943.cuypepvflte2cynr@linaro.org> References: <20180228181432.26847-1-manivannan.sadhasivam@linaro.org> <20180228181432.26847-5-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On Wed, Feb 28, 2018 at 08:36:53PM +0200, Andy Shevchenko wrote: > 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(). > Okay. Will add a helper. > > +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? > Ack. > > + 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(). > Ack. > > +} > > > +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? > As stated in the binding doc, valid values for the slew rate parameter are: 0 - Slow 1 - Fast > > + return 0; > > +} > > + > > +static int owl_group_config_get(struct pinctrl_dev *pctrldev, > > + unsigned int group, > > + unsigned long *config) > > +{ > > + int ret = 0; > > Redundant assignment. > Ack. > > +} > > > +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. > Ack. Will return 0 directly. > > + 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(). > Ack. > > + return ret; > > return 0; ? > Okay. > > +} > > > +int owl_pinctrl_probe(struct platform_device *pdev, > > + struct owl_pinctrl_soc_data *soc_data) > > +{ > > > + clk_prepare_enable(pctrl->clk); > > This can fail. > Okay. Will add a check. > > +} > > > +static const struct of_device_id s900_pinctrl_of_match[] = { > > + { .compatible = "actions,s900-pinctrl", }, > > > + { }, > > No comma needed. > Okay. Thanks for the review. Regards, Mani > > +}; > > -- > With Best Regards, > Andy Shevchenko