Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp757225ybh; Wed, 15 Jul 2020 14:33:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSSyBxB4+oEL+26X1RiJ2H0mLwDSgykKlY8amv+ONVuiNTY4cij+Dq9lyVcgfYGjw5C8nx X-Received: by 2002:aa7:c655:: with SMTP id z21mr1581493edr.330.1594848784656; Wed, 15 Jul 2020 14:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594848784; cv=none; d=google.com; s=arc-20160816; b=VMQXLxBQoliaGTehBLLgAeBH2kIg9HRRZ+okC0JDOWAQrzu7gz+y3FLeObK92Ntibs j1RK3YueFv/7mNtfhZcOfvu/o4xmkyq27BZ5audbAAnbUEC7V67lxFJNn9nlesNW8paj EtBwUohbN79sfqcVNpNb1+qP/eMc55+MrJx9GySKQb1lEbYf2f8lOrXOq41k04mvXUoT FWcV7MOzrLBykUVaGOCJQyoO2f6Vt550A8JrV78Uty+aXaPnOvmW4zE2ZpxfseByUQAs F70X94VLpXkVQ3Pi4sOSHwQmesA3HLjAuNvEXRRGYEAKWsx3O7xFJjAfD+daufWJVCD1 Of1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xBQDfVfj7jVd5q1Z7DUJytLJRXAUVyPchfWSKcEiidM=; b=ypL3qT6MKS2RKNlWz9UCoWB1qn5IkSRXBLWE6mXfSziZBtjg6xQU9f5+9pcq839LCW DTDnkU5bdc4J6NF3tew5fHczMKc0ezVUPGtBTWxPt33XQn72y3J5twWZg34/ezDnch1b u5FdkQXkPjIjvqtmjOsg4GpKgtnsH4g4kC1jmzxw9yXy6k8byg2qRngpZ4eN6fhUfLd0 q4OZiTc67Mvc5ZIEiGVD6bvCBa6ir/x70oZJmmlPvGQkybaJ3dMyA9NiVc3PBXFhi1HB BXvPvPzqjW16OSShVCwXZM0pgFI9Tcsf9KoMi2KbNkB5qDGV4vU8FEMHl5kww5wOxwmr RdNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@beagleboard-org.20150623.gappssmtp.com header.s=20150623 header.b=wKKvAWhb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si2064028edt.8.2020.07.15.14.32.41; Wed, 15 Jul 2020 14:33:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@beagleboard-org.20150623.gappssmtp.com header.s=20150623 header.b=wKKvAWhb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727043AbgGOVcK (ORCPT + 99 others); Wed, 15 Jul 2020 17:32:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726998AbgGOVcJ (ORCPT ); Wed, 15 Jul 2020 17:32:09 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94A19C08C5CE for ; Wed, 15 Jul 2020 14:32:09 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id o2so7693651wmh.2 for ; Wed, 15 Jul 2020 14:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xBQDfVfj7jVd5q1Z7DUJytLJRXAUVyPchfWSKcEiidM=; b=wKKvAWhbIOGuT1WASkV4LvqzLA0Zv0x2m8Nwk6wRJkg4gE7pNdCYPt+AdS90IlQaIM Nzcl2lwkD3LoPZ8bF5ALatUnatULp2Bn5/CUNG7X+VLqrUxtADV6a747KGhm6+NoH1QZ ft5ET3hyn81yG5M+gDoweEZClfAQ1h+HWI3gJh2l9k6HyFR4HjtWKKhbXcZrNZC8+GXO 29VbKG8+4257sY2bj7atKlJXyHsyoaPkCxFyhXsjoeQ2wegGaPLj9LFe0GtBdC/BRjU1 9MmtkPGAyn3L9YrWf+cUdr+oTfbeUlaHjNw4HPhm0nnyEx2r+BWUKa2VKvf9Cdgf9Ry0 Bolg== 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; bh=xBQDfVfj7jVd5q1Z7DUJytLJRXAUVyPchfWSKcEiidM=; b=QE5RvoWFCtlCzdoOV89C5HV8BsJ7HXtBz05sjBhTlocAyFpGtUgkdN3571sNv7jZxf heL+JytsRSoOksinWsDarZZqkTYP6wtNGLw7Yj4jLUVDWot4UBnY1OTDkyoJz9213eZR hsltVHFMjkD6clquT7bVFvk9UHtgYYhCPkiY4u6IuCpL3LYioWKdK8ACl0sS6oBxAzEO MUdaxDI8EiigHlQu2F+g1MogeGRqrp7F9bcfCbzxpfOHKy+L7eYmXHKPanX8iN9Rtmh1 Q37fGMYAyTTeq5m3OMDMvfxKMcA++qgXICtcvSGMdPSRpBLiOt8BrZFAM2/WfnOHM12J nzIA== X-Gm-Message-State: AOAM531VK0hFNSD54u//yJ/z8FZUO+6UXniUni35ZaZVyP9xfM9VSyId qkbmd63ydzf2AgQHTfosYvvHiQ== X-Received: by 2002:a1c:1d04:: with SMTP id d4mr1545579wmd.156.1594848728233; Wed, 15 Jul 2020 14:32:08 -0700 (PDT) Received: from x1 (63.red-95-125-106.dynamicip.rima-tde.net. [95.125.106.63]) by smtp.gmail.com with ESMTPSA id 1sm4912324wmf.0.2020.07.15.14.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 14:32:07 -0700 (PDT) Date: Wed, 15 Jul 2020 23:32:03 +0200 From: Drew Fustini To: Grygorii Strashko Cc: Tony Lindgren , Linus Walleij , Bartosz Golaszewski , Santosh Shilimkar , Kevin Hilman , linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] gpio: omap: handle pin config bias flags Message-ID: <20200715213203.GA1639870@x1> References: <20200709223401.780051-1-drew@beagleboard.org> <1a0180f3-7693-672a-8070-7032854bb73c@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1a0180f3-7693-672a-8070-7032854bb73c@ti.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 15, 2020 at 01:09:12PM +0300, Grygorii Strashko wrote: > > > On 10/07/2020 01:34, Drew Fustini wrote: > > Modify omap_gpio_set_config() to handle pin config bias flags by calling > > gpiochip_generic_config(). > > > > The pin group for the gpio line must have the corresponding pinconf > > properties: > > > > PIN_CONFIG_BIAS_PULL_UP requires "pinctrl-single,bias-pullup" > > PIN_CONFIG_BIAS_PULL_DOWN requires "pinctrl-single,bias-pulldown" > > > > This is necessary for pcs_pinconf_set() to find the requested bias > > parameter in the PIN_MAP_TYPE_CONFIGS_GROUP pinctrl map. > > > > Signed-off-by: Drew Fustini > > --- > > drivers/gpio/gpio-omap.c | 21 +++++++++++++++++---- > > 1 file changed, 17 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c > > index b8e2ecc3eade..a471a152f318 100644 > > --- a/drivers/gpio/gpio-omap.c > > +++ b/drivers/gpio/gpio-omap.c > > @@ -896,12 +896,25 @@ static int omap_gpio_set_config(struct gpio_chip *chip, unsigned offset, > > unsigned long config) > > { > > u32 debounce; > > + int ret; > > ret = -ENOTSUPP; > > > - if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE) > > - return -ENOTSUPP; > > + if ((pinconf_to_config_param(config) == PIN_CONFIG_BIAS_DISABLE) || > > + (pinconf_to_config_param(config) == PIN_CONFIG_BIAS_PULL_UP) || > > + (pinconf_to_config_param(config) == PIN_CONFIG_BIAS_PULL_DOWN)) > > + { > > + ret = gpiochip_generic_config(chip, offset, config); > > + } > > + else if (pinconf_to_config_param(config) == PIN_CONFIG_INPUT_DEBOUNCE) > > + { > > + debounce = pinconf_to_config_argument(config); > > + ret = omap_gpio_debounce(chip, offset, debounce); > > + } > > + else > > + { > > + ret = -ENOTSUPP; > > + } > > drop above "else"? > > > - debounce = pinconf_to_config_argument(config); > > - return omap_gpio_debounce(chip, offset, debounce); > > + return ret; > > } > > static void omap_gpio_set(struct gpio_chip *chip, unsigned offset, int value) > > > > Minor comment, Otherwise: > Acked-by: Grygorii Strashko > > -- > Best regards, > grygorii Thanks for reviewing. I'll post a new version with the return value improvement per your suggestion. -Drew