From patchwork Fri Sep 1 11:29:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 719615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E01EDCA0FE6 for ; Fri, 1 Sep 2023 11:29:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241189AbjIAL3m (ORCPT ); Fri, 1 Sep 2023 07:29:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240050AbjIAL3l (ORCPT ); Fri, 1 Sep 2023 07:29:41 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 292D4E42 for ; Fri, 1 Sep 2023 04:29:36 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fe4cdb72b9so19562585e9.0 for ; Fri, 01 Sep 2023 04:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1693567774; x=1694172574; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9QYuTBLdcdSSpLg2t1QnpqmU64bzrT7uyyeDzbSmAKE=; b=gKSVxt9ac7QAE7muzkslUKmearbXKrc/X0I/pzidaVZKdgBCK4ZoPgwA7O/X+atxHm 3Cd2yTtbxURQQU7xqEcycArEDpagtp3MtnS/vsyJz12lzzX00ROwfoauPoOHMlc0S+32 oBKHy5avNQr3ChkXvtuKOcWfTvUI/dhBvBnxPFfTUPgyGvjCY1k4edhmAGnK0iUFtT7G AmSADYHSMeW/jsJ4wOSn+wmUB7Jd+brlQgRJL8GzyuHYwL7RhaeX3bF4BpIf/i4k48xG XF4Tfx4dJo/jKITmcMqbLoVtz/MRUP3NKwIZPH3L/RZDXnmsEMCFxrf9zzrr19pL7PYY fNJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693567774; x=1694172574; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9QYuTBLdcdSSpLg2t1QnpqmU64bzrT7uyyeDzbSmAKE=; b=XzfYwYD/DmoY9pAMkFHVwIbGGmpOAVQvufbGNkeG93Vz4tbQAz5pma4EmtC60Opvew RtXile4WeIjzAxyZDgh2h4AU1l+I2JvCqxBEVx8jcOUUGLfZlttwWxdktxxCDESqEL3K xo5p2PAJIx6pzKXt9vwy5/cIegggBSv4mqwJlgOE8LVe9wzRceJy/CbZU3zcDv4m6mFg E7qZRgslmEDzSixb1rD89PZ5wede//p/vfioXE9fg6xW6mhwpGaUPAdCprCXa3GgOOdX Br1PDxmyKyzOKv7HHeBbdRlBR26+NZeesGFkFDHuzZmxnQ8PceLcFQfZFiCt2OGSJiB4 wEiA== X-Gm-Message-State: AOJu0YxT3oMQ86LelAmSL54k1l6yQyxZ2hLNx4qWNW1699pg6vOLLqqi e6l6QfCkZshof/HGOO4saKuEJg== X-Google-Smtp-Source: AGHT+IHllpPvaZNB2c+2YSkS92WGiunk/yYBY2OTKwzTT/tn33a1esj5a80JaFodL/HQolRnLFoMNw== X-Received: by 2002:a05:600c:20e:b0:3fe:19cf:93c9 with SMTP id 14-20020a05600c020e00b003fe19cf93c9mr1651768wmi.1.1693567774720; Fri, 01 Sep 2023 04:29:34 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:e94b:1054:6760:aa27]) by smtp.gmail.com with ESMTPSA id a28-20020a5d457c000000b00317f70240afsm4963426wrc.27.2023.09.01.04.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Sep 2023 04:29:34 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko Cc: Support Opensource , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 1/3] pinctrl: da9062: add missing include Date: Fri, 1 Sep 2023 13:29:24 +0200 Message-Id: <20230901112926.13216-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901112926.13216-1-brgl@bgdev.pl> References: <20230901112926.13216-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Bartosz Golaszewski gpiod_is_active_low() is defined in linux/gpio/consumer.h. It's only because we're pulling in the gpiolib.h private header that we get this declaration implicitly but let's fix it as that is going away soon. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij --- drivers/pinctrl/pinctrl-da9062.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/pinctrl-da9062.c b/drivers/pinctrl/pinctrl-da9062.c index 0e0ac3f3ffef..9239b9cd9002 100644 --- a/drivers/pinctrl/pinctrl-da9062.c +++ b/drivers/pinctrl/pinctrl-da9062.c @@ -17,6 +17,7 @@ #include #include +#include #include #include From patchwork Fri Sep 1 11:29:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 719811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BACACCA0FE9 for ; Fri, 1 Sep 2023 11:29:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349163AbjIAL3m (ORCPT ); Fri, 1 Sep 2023 07:29:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240516AbjIAL3l (ORCPT ); Fri, 1 Sep 2023 07:29:41 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D1F01B2 for ; Fri, 1 Sep 2023 04:29:37 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-31c4d5bd69cso1577678f8f.3 for ; Fri, 01 Sep 2023 04:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1693567775; x=1694172575; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tdNzHMrDYEjbwJ343USEGvpLxvkS/UUHzfPWvixkwgI=; b=vUvxVayrJa3jfw3fWpBLSO0qhvC+2GvXcjOLRcMmzvfDQNrO6QFhiECw6F5GZiI2Lg JBs2j9+o1afzYxJwSSGIm2mnVirwKeOJ8TRYck1zFHQqkon+LbXVMRuaQwHDJGRNUbUE /igGC7cR13BqmE9yQLjJYO/FBXzhTmQe2bWP9xmj3gPmJKnTtcJN2bn4399EkAJyZOME f0DfmDukrLBkAUsOvSMOCIX9YJFbClGC2+TgT7LgXPLUGf9BQjYX0QIzZGlzbi49PDGZ N6KjjKTB65hD911FSgPKGxKnv7wLqfvZuDXLVpdbfDe2ogK+cTkeJ+wOkyZwPDHCK3hV Kyeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693567775; x=1694172575; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tdNzHMrDYEjbwJ343USEGvpLxvkS/UUHzfPWvixkwgI=; b=j3jJTSP31DVm4CKsodTMuUj5IQ/s0VgS2bETz2tb5uumvL7rzNtVQf/ygEowcaokZy B7gkG3Mk+kbFIs+uSjnCww8VRUsEgVoTWbvz4ygE7+Z/ypWD/aSHiGkBoOF4AiuUA2e3 UsAET8RgrKEYJdO0of2ArpvkcvSDRnP9HD/Tu5SE5cCMlKeOEUx2YXDUK2efxNhLOoeQ ElH0dHtTPay71J9DRC5t0xFa2Muhj4hHwjjQbm/P2pm7t1nL7x6Rfy3PFFqJJUipj0Yi M9D1LnWhsP1QHIDs9o11L9HxArXSUGiV5a7RWhmk10Zdt5R8ldq0atqSG2o/7NDaLhFd AXFQ== X-Gm-Message-State: AOJu0Yy+3CIWNGyVSbQFEVsPPOdo+qF5nT+bOn/8S0zQkQvzpaYLYhmW CZYtohHoG4cHgeKNdJZRZ4qZ7Q== X-Google-Smtp-Source: AGHT+IFOxs7U639zLRVdB1ruPdh9fBP79ym795QX/3xyEFiPIbi9EOLt7eNqTZD30VyFW28BsiFsYw== X-Received: by 2002:a5d:464b:0:b0:31d:da10:e471 with SMTP id j11-20020a5d464b000000b0031dda10e471mr1642148wrs.69.1693567775582; Fri, 01 Sep 2023 04:29:35 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:e94b:1054:6760:aa27]) by smtp.gmail.com with ESMTPSA id a28-20020a5d457c000000b00317f70240afsm4963426wrc.27.2023.09.01.04.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Sep 2023 04:29:35 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko Cc: Support Opensource , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 2/3] gpiolib: make gpiochip_get_desc() public Date: Fri, 1 Sep 2023 13:29:25 +0200 Message-Id: <20230901112926.13216-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901112926.13216-1-brgl@bgdev.pl> References: <20230901112926.13216-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Bartosz Golaszewski It makes sense for a GPIO driver to want to get its own descriptor without requesting it. After all, the driver knows that it'll still be valid. Let's move this helper to linux/gpio/driver.h. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpiolib.h | 2 -- include/linux/gpio/driver.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h index a0a67569300b..09c5feb01d52 100644 --- a/drivers/gpio/gpiolib.h +++ b/drivers/gpio/gpiolib.h @@ -122,8 +122,6 @@ struct gpio_array { unsigned long invert_mask[]; }; -struct gpio_desc *gpiochip_get_desc(struct gpio_chip *gc, unsigned int hwnum); - #define for_each_gpio_desc(gc, desc) \ for (unsigned int __i = 0; \ __i < gc->ngpio && (desc = gpiochip_get_desc(gc, __i)); \ diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 4f0c5d62c8f3..8fc3ceffcbe9 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -758,6 +758,8 @@ struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc, enum gpiod_flags dflags); void gpiochip_free_own_desc(struct gpio_desc *desc); +struct gpio_desc *gpiochip_get_desc(struct gpio_chip *gc, unsigned int hwnum); + #ifdef CONFIG_GPIOLIB /* lock/unlock as IRQ */ From patchwork Fri Sep 1 11:29:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 719614 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D12ECA0FE6 for ; Fri, 1 Sep 2023 11:29:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349164AbjIAL3n (ORCPT ); Fri, 1 Sep 2023 07:29:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240050AbjIAL3m (ORCPT ); Fri, 1 Sep 2023 07:29:42 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA76110D3 for ; Fri, 1 Sep 2023 04:29:37 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-401b393df02so19367065e9.1 for ; Fri, 01 Sep 2023 04:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1693567776; x=1694172576; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tu4OfRROT7gdZwvbBdXio/1x3hbxyqPiGugfXIkYo/0=; b=DAXUbWrEMDr6aa6gKPQdalUC0woO6WUC9eV9ZhswcxFSAJgE42CoTE54uyF3xXe16P P0zTdoKIaOO7nGnUnCUelwl5YG2D3jtM+Ge4BgtmdDbZyjfbbrRrhReJ3mRedeK6DnL5 izn55ET3+Ml8XDEC82Lp4RK+GvSVn0V4lkbY09zj3JlsDZankpJxDSk3ClDj3H0h41qP eXSs9/loDT8Bk//I9QMdOd8bXehd4QFNE6nbZ1ux3FN6fcPPNCw6IiOYfpxMMmqOqYR6 cmOlTUbT9pkYeBj1oCFqyP8UgcEF2FvT8/45+EcwxQ3pLDC0xIHxKdq0CJZsGE/AO+VB WICQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693567776; x=1694172576; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tu4OfRROT7gdZwvbBdXio/1x3hbxyqPiGugfXIkYo/0=; b=IEWPinKfcJRneh0BB+YMvebYFR8fUhf14GgxSTtk7mnnYwUjNQjliu6VjPfJPuxvty e+cDeZ+2bZYBRxzX/nVQSNopZCR8ChKxK6AMLhqU2wkrjnj97BwK0WDoCcljIhaSQX+k ziSVhQYLGOrZlxUDp+tIJwCcp3PBpczz+DdQSscuUEaxYbs1G7C4SEUVAw/l+GPVL6JQ UHGt167DPJ59U+xk2nep/cfhPOOy8ZkBgQU3P18iJTYsDIz5rKuMJ34+lQpqYzRzX1ef FbR7YshcLaNeYiTSkCdC8rLTMGuvWKWC4pkY59OPF5BSV+Vu03PM0oAnxrfKtwr0U6TA CXfQ== X-Gm-Message-State: AOJu0YyWocPW74Z5kWmUwc4pB9MN1F+AvCUBUBuEKwb6Bb+Dl3hXhm0W nZd7JMiMosA4KEcg8MY3C8eoRA== X-Google-Smtp-Source: AGHT+IHIGzMxeHFtHXrQ21rQASy8FstyQyzoqQ5sDyEjiv5Strpzo00wvLahj0KIaTtmZ0GaoN5stA== X-Received: by 2002:a05:600c:298:b0:401:c075:d5b with SMTP id 24-20020a05600c029800b00401c0750d5bmr1599260wmk.26.1693567776426; Fri, 01 Sep 2023 04:29:36 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:e94b:1054:6760:aa27]) by smtp.gmail.com with ESMTPSA id a28-20020a5d457c000000b00317f70240afsm4963426wrc.27.2023.09.01.04.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Sep 2023 04:29:36 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko Cc: Support Opensource , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 3/3] pinctrl: da9062: don't include private GPIOLIB header Date: Fri, 1 Sep 2023 13:29:26 +0200 Message-Id: <20230901112926.13216-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901112926.13216-1-brgl@bgdev.pl> References: <20230901112926.13216-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Bartosz Golaszewski gpiochip_get_desc() now lives in linux/gpio/driver.h and there is no longer any need to include GPIOLIB's private header. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/pinctrl-da9062.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-da9062.c b/drivers/pinctrl/pinctrl-da9062.c index 9239b9cd9002..3998b27cbe0e 100644 --- a/drivers/pinctrl/pinctrl-da9062.c +++ b/drivers/pinctrl/pinctrl-da9062.c @@ -23,12 +23,6 @@ #include #include -/* - * We need this get the gpio_desc from a tuple to decide if - * the gpio is active low without a vendor specific dt-binding. - */ -#include "../gpio/gpiolib.h" - #define DA9062_TYPE(offset) (4 * (offset % 2)) #define DA9062_PIN_SHIFT(offset) (4 * (offset % 2)) #define DA9062_PIN_ALTERNATE 0x00 /* gpio alternate mode */