Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp644232rdg; Wed, 11 Oct 2023 00:59:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7oz4rQk2G5WW37U9HwkczpSQrW6fQMdeTsVRibf8wXVuVmGhARXU+LMCSNL7cNw5IcQhl X-Received: by 2002:aa7:8884:0:b0:68a:5773:6319 with SMTP id z4-20020aa78884000000b0068a57736319mr25359588pfe.11.1697011175664; Wed, 11 Oct 2023 00:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697011175; cv=none; d=google.com; s=arc-20160816; b=DEHmLMZv+LmgVfXIkRIEYTGPGneamRV4sby6by82i5/gyxWB0c3mcmOurJx14qKidC sS3ulVME9mRCK3Wk/+sbRJHQQ3ske0wEnPxIfXmYupYjTWXGwf2b/qhNvaiOPS88BbgL 7RigQs5buZZrFp6wRG6XApkMI3bSKzGSdsZa7ByiRaEZHId7buM58b06YIMg3/yssP/P bMpcV+d4yNSZpoWKxJNcqmKfjOF3gE9mu7AbnlswZuG91DikzlxiGXt6RcheMCo64wke OZiCbtuwKfl3ivtCDv96ocGFc1wE9R/bkzQnMT8bLjuzPdqL3j4oQ5RWIAZ2QedTGNXO /98w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4T+G3IiEpAugHoIlaD3hRukPzEGsZANvnqJPVq5ffG8=; fh=fzr8YSgU5DXwnzWa740SvV8soeae0YfYC7xL9RvdF6o=; b=HaOxG5KDEcJZSt2GvDkqFKORroVbugPJXiY3S4Zj+RtNq8DEgaoXa4ONEk5t/ZejFE oLVbry0QSUL+450FftXSIGTcRIdhxYF5WUNjvkeAlwNPO+owE2cYlLG0qhFkVTVg12Ou QYQ9jjxB8mK5uwAMct02jCQMpFajj7Wf4Nmj1apMgekb0NEOcdZZ+6uEcLY50kGIUXO9 IlHx9RGByWjhel8vVzryTQlbtv39wtRDWDyMlCZzbc2SXtZUakZ1OF3z+YEwp90MJntv tZQnN9ImBYD2s8MKT/sacYk58wBUP5brHJ2K6LqcTQRdyHDUizP78SE03gD+C/x+JLS8 kfDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=jtSdGqV2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q4-20020a056a00088400b00690d8405fe2si12097769pfj.60.2023.10.11.00.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 00:59:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=jtSdGqV2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id DB29D80A7E49; Wed, 11 Oct 2023 00:59:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345054AbjJKH7a (ORCPT + 99 others); Wed, 11 Oct 2023 03:59:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344927AbjJKH73 (ORCPT ); Wed, 11 Oct 2023 03:59:29 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DE7492 for ; Wed, 11 Oct 2023 00:59:26 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id ada2fe7eead31-4527ba546d2so2365548137.2 for ; Wed, 11 Oct 2023 00:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1697011165; x=1697615965; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4T+G3IiEpAugHoIlaD3hRukPzEGsZANvnqJPVq5ffG8=; b=jtSdGqV2QaB1dOZo3W8RC2BtHpnoWBXPFoZBsrbiBrX+lRAozmlcb3QzUwCgAUIVk6 ELN119v7dd4ks9xxLOu9cTvqgzOt9DWwTEzjsgCGtvHRKY6c2t3UQvmKBLb24ty4q0vh NTPbPVe8ciCe+LA2FlYgSTIW6BFZLA9wTUl+//dDA14PSdxc9S24vx9qrovAHpwZD5/y GLEwzIdjZqOdk7Ukz51ZHO41UVP7CcxfPQhbefK9ViUlO5eLaUNFkKIvcNMsOgECxKsh w8EeLSLrq+zytqqyPzsrqU4c99R4uku5BwHZLtiWcYCzuFHsOSFI6MqfsPicfUdROCSr GfLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697011165; x=1697615965; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4T+G3IiEpAugHoIlaD3hRukPzEGsZANvnqJPVq5ffG8=; b=fJa9BCNG4kwio+gA9jh44J7DheP+nKSp3rtII6h3BgZd0qf+cC1VBZlveEe1siFGNk m9+8txO9jNMaRg7txLo+WdRSqyaQj9e8/ramigZyx+puOMKle6np7/ivIdNJ8xSb0Vli 6m6c6Kn1D3hshF4ewQJNFEIDRJTwAmpqCVBT1UPFWUJ62sK8QtlGWoZk1ZSLoI6VqEei UW91CJP7AiJzQxj2OVdgRlvQGqtL5v5/cbRG/J7zG2MNZPSxvUwai5IDtQ0j+XKNEK2w 3ONiQAMk6OWmRMVkEa6gGS8uS+qhSVynd84KS3VoqnKdY9+x4UKcaMNtSOl4BYgVm4mF T7mg== X-Gm-Message-State: AOJu0YzZ87itghe5Tf+gJ9jo5uF4NMx9x4gE95T2El8tZsRwRyimOZM6 HcXp1VuGe8c95mfeVGB/b3/4k+EkzPclkdXc+HoNDQ== X-Received: by 2002:a67:f950:0:b0:44e:8c20:a92d with SMTP id u16-20020a67f950000000b0044e8c20a92dmr14800228vsq.7.1697011165108; Wed, 11 Oct 2023 00:59:25 -0700 (PDT) MIME-Version: 1.0 References: <20231009-pxa-gpio-v7-0-c8f5f403e856@skole.hr> <20231009-pxa-gpio-v7-2-c8f5f403e856@skole.hr> <12313687.O9o76ZdvQC@radijator> In-Reply-To: From: Bartosz Golaszewski Date: Wed, 11 Oct 2023 09:59:14 +0200 Message-ID: Subject: Re: [PATCH RFT v7 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors To: Linus Walleij Cc: =?UTF-8?Q?Duje_Mihanovi=C4=87?= , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King , Alan Stern , Greg Kroah-Hartman , Andy Shevchenko , Dmitry Torokhov , Mark Brown , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-spi@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 00:59:35 -0700 (PDT) On Tue, Oct 10, 2023 at 10:04=E2=80=AFPM Linus Walleij wrote: > > On Tue, Oct 10, 2023 at 7:39=E2=80=AFPM Bartosz Golaszewski wrote: > > > It doesn't seem like anyone is using these GPIOs once they're > > requested? Wouldn't the above definitios be analogous to: > > > > GPIO_HOG("pxa-gpio", SPITZ_GPIO_LED_ORANGE, NULL, GPIO_ACTIVE_HIGH, GPI= OD_ASIS) > > GPIO_HOG("pxa-gpio", SPITZ_GPIO_LED_GREEN, NULL, GPIO_ACTIVE_HIGH, GPIO= D_ASIS) > > They are used: > + spitz_gpio_leds[0].gpiod =3D leds->desc[0]; > + spitz_gpio_leds[1].gpiod =3D leds->desc[1]; > > The descriptors are passed to the leds-gpio driver. > > But wait: no. > > This whole thing: > > +static struct gpio_descs *leds; > + > (...) > + leds =3D gpiod_get_array_optional(&spitz_led_device.dev, > + NULL, GPIOD_ASIS); > + spitz_gpio_leds[0].gpiod =3D leds->desc[0]; > + spitz_gpio_leds[1].gpiod =3D leds->desc[1]; > > Just delete all that. > > The leds-gpio driver will request and use the lines. > > It was just so unorthodox that I missed it. Adding the descriptor > table is enough. Ah, good catch. Your suggestion is of course the correct one. Bart > > Yours, > Linus Walleij