Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp304496rdg; Tue, 10 Oct 2023 10:40:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5U2JZGmq0lzadoryyxomdk1q5JGjDTZrh4O/4KsURN3ZwkqS1SNafJFDyUzeMD0D+Fy9M X-Received: by 2002:aca:2315:0:b0:3ae:a81:55a9 with SMTP id e21-20020aca2315000000b003ae0a8155a9mr20463231oie.24.1696959636031; Tue, 10 Oct 2023 10:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696959635; cv=none; d=google.com; s=arc-20160816; b=J+o85Joj15zJFO48ASEY1d4rRAOiNejk4nAnxQyv2Ugaa6XxZxdOzI2I6Hyv5kEGY0 x5W6/8Kl7sQKhh76VtWHjn6teKL3WIniBGczBHKF9/uF7slvuiVw/ogwdsYj9w52yAY8 S3y7+uDObIfANOVWDlppWGPlq6Id2gHA0NzbY8mLkU0F8OxqlKxT+phsjnVPyVa8aYRb 5Hm88DCAxK7YZj73hfIuhKFdb2djUPSxFwkhnkeGmmpewaRHS1G0yc1eteoL4IseD8S7 isER38YSLJNBTBsNZPVk660SRIqX/sa/PbiS4joTkhrIZpMTBiRhr4sVYkXbCuQmeOD/ XAmw== 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=r4xZpqEwWtfUV1JgIse7nmPsmTUQIv/zlM1eTbPf9Zc=; fh=bD0irRExCR9U/CdLuI02LRr7jOWxzGkti19Icxfbv34=; b=lvWE1LkAFhFElhPy53yGWaDghJm2Zwgiq1BxX0qcDJlMH6CtM875RglvkHBhakdlf2 0gG5NTOSizQ5EvDVXV8ZBoC7sNeaybVpDwYSmhBTkKEs2DHevcoIJYXohFi0qOMcX/NG zVy5F6msptGhX2mBAsq/XFwVKSBGiGNqjFHrvjQfcgDiB/LbXJUMQflhbhshSh3It+R+ i2xpkDPdRUgMYNVtJfHHLT6Ow29wN8H9ThDN/7OY2rjyhHAvTfrxxVAp4pssWnB9ud8d l2LCtxA01dwrX+UOMXou2KFyULrKgJl+5Z4FD0qQIAVpAID+auxj8MHAUiEQxtYyMs75 fcyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=D0BZI28A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id i69-20020a636d48000000b00584af407e80si12487753pgc.293.2023.10.10.10.40.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:40:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=D0BZI28A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id DAF0A81BFAAF; Tue, 10 Oct 2023 10:40:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231501AbjJJRkB (ORCPT + 99 others); Tue, 10 Oct 2023 13:40:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233870AbjJJRkA (ORCPT ); Tue, 10 Oct 2023 13:40:00 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61160CA for ; Tue, 10 Oct 2023 10:39:57 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50306b2920dso100509e87.0 for ; Tue, 10 Oct 2023 10:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1696959595; x=1697564395; 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=r4xZpqEwWtfUV1JgIse7nmPsmTUQIv/zlM1eTbPf9Zc=; b=D0BZI28AAuxlKIwt2Y0k5v38edjDTKmuGVqY4uy/m17vCEsvmGEbcvOwDu87+7Zb9V 0D6uCHCzHrBQJrLK/5KTiArgrqq+0ibHB9va84XZdmlUDh9QtD5GZM4bFuHEeVU9MRMU 9W8ZS1kPKpa5LoCDSDqj99t1Rb/Oxi4oGfL5BneZuZ+Qtoh1p8Wo7FXn/BNfu4j7H6U1 dCFQrt9mb7tM9LIVgnURnMzgEAwYMNJvgBPZkR7CP6Ym7oBY4JopAmdrGIsJ2rrCq3fz qI+hyUqFE8OS+ZmLzq51i92wjxsPjSMs0LSIA8Ahuer7gRileC0Ia2p9cg2TsMZmWUY3 34Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696959595; x=1697564395; 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=r4xZpqEwWtfUV1JgIse7nmPsmTUQIv/zlM1eTbPf9Zc=; b=E1TAaZQLbcgjTOFni/wRDOeYd2Jk5tQw0v/jqpvxY+StB2PUlN33t71OVXjw2w9zq5 6i7BABfbpdIIA1b3faayrp43OJzePiIfhhdJwc5+4FqmSjZzeN693b72sopBE+kgrTYV 9qg/3lmT7wfu9p4L2a0UAiMdJQyqs9Uxf2qUIpbNaPNnIHtWEYJDwWZR9XA0gtnsERhE gkp5KQ86Ovd7INYVDlLCdxO54k7b4HMphlDsS5mC+CZ9CqrkaE/5Cc6xUkEB8lLVro3N e0yjv20Tb6G5zFIHQo1grBhA7TUSH37uNLRrEz+M0ULZmkrRFS+3mYvFveoSS/JyDDEc kVTw== X-Gm-Message-State: AOJu0YxdofgFzL+tln29psSZh1QguE2v6OtRhp9JO3Xs5+YcwuYLKNW5 irbyJy7TyHhvjTZefsHT1mQ8xKggHqWLBlUlEwmcdg== X-Received: by 2002:a05:6512:3183:b0:503:2879:567 with SMTP id i3-20020a056512318300b0050328790567mr13675359lfe.28.1696959595193; Tue, 10 Oct 2023 10:39:55 -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: <12313687.O9o76ZdvQC@radijator> From: Bartosz Golaszewski Date: Tue, 10 Oct 2023 19:39:43 +0200 Message-ID: Subject: Re: [PATCH RFT v7 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors To: =?UTF-8?Q?Duje_Mihanovi=C4=87?= Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King , Alan Stern , Greg Kroah-Hartman , Linus Walleij , 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=2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Tue, 10 Oct 2023 10:40:11 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 10, 2023 at 6:33=E2=80=AFPM Duje Mihanovi=C4=87 wrote: > > On Tuesday, October 10, 2023 1:12:05 PM CEST Bartosz Golaszewski wrote: > > Gah! I should have noticed this earlier but this is a perfect > > candidate for using hogs. Can you use gpiod_add_hogs() from > > linux/gpio/machine.h instead? That would save you having the lookup > > and the static leds descriptor array. > > From what I can tell, the hogs keep a certain pin at a certain state as l= ong > as the machine is powered on. Is this really what we want to do with LEDs= or > am I missing something? > 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, GPIOD_A= SIS) GPIO_HOG("pxa-gpio", SPITZ_GPIO_LED_GREEN, NULL, GPIO_ACTIVE_HIGH, GPIOD_AS= IS) ? Bart