Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp382122rdg; Tue, 10 Oct 2023 13:08:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbxTIfRwmce+aD3mu9tUCZXb4FS2abI60pOTD8Bd/IunK+aVcurT+/GIn5Odsq7RulqvVS X-Received: by 2002:aa7:8894:0:b0:68f:edfd:2ac6 with SMTP id z20-20020aa78894000000b0068fedfd2ac6mr22683257pfe.0.1696968483349; Tue, 10 Oct 2023 13:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696968483; cv=none; d=google.com; s=arc-20160816; b=Q0D5RPrjB4IhVHuge1tUfX07KARexD2h/NagIJVx8l6XdZet8lQuDR9ej5Ex1CM/Sw 5WI9R9ykZAwQuesJf3zosy50LdtQ6rplIyDH1a1FZMnJiV7atLKv6yG3SKq8RGstYzJT FytmXEhiSAZ3T4bxNGVvWZt/RKQpCFX/CC88bpWS9uzbtH/RVKmQzEkkeAVqH+ODUZFk +ehnRRbRy/vUo5i/6A0CSh9x6SYY9jie+oOLPM/pwricXPezPWenbKjaGBhUG1hWeBNH yzdOEGWadygwvHqJ9NQkOfZSqdB3VHBs+U4oJjWJMY1h/K562OQrvVMTT2r1DqI9DJRI xRVQ== 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=Dsgx0xQPge+9HmU8GeSr2i19e9kEWopqk+L20TkvvHU=; fh=acvjjBIMWOoI+k6yZavjUr68n9wWuvEa6kq0JdQNVQU=; b=sw/Z5sPo3TyA/26xahofWkGbQjeJShKUUBYn/zDJlsT8SvnT55azGJshf5HfKVSGKz Qs2kOm7iL8uI4UuN5VTsdrq+zD3TqaGVOlFWAG0BphNhFSJ7ku0QkP4rQNovTeggkLO/ 9fQbhYXDEBxUTSoSuEJmcIkIF3G9lT9xTNu6TiSTVnzZihiiNn0c+pvNtqVaymWxYxIK EbZKBsUaKDYW1AWSzZ70kjUipQrdWH2GAUMLOruaH0c+Fn0QYyQCoNRigEU9pVh+wIGM 2fyTazEZSsdo7X/ekcNgoA7mf2hXj5KQEoDCBylKDrN87o6/OMexKaFbw4R2mmZL6M2o RxBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jYRDHubk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id t21-20020a639555000000b0059ceeb24a48si1669587pgn.680.2023.10.10.13.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 13:08:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jYRDHubk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D81DC83B7A92; Tue, 10 Oct 2023 13:07:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234719AbjJJUGx (ORCPT + 99 others); Tue, 10 Oct 2023 16:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234646AbjJJUEx (ORCPT ); Tue, 10 Oct 2023 16:04:53 -0400 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB12D5B for ; Tue, 10 Oct 2023 13:04:27 -0700 (PDT) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-5a7b91faf40so18851377b3.1 for ; Tue, 10 Oct 2023 13:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696968266; x=1697573066; 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=Dsgx0xQPge+9HmU8GeSr2i19e9kEWopqk+L20TkvvHU=; b=jYRDHubkHHeppyz50JJbbaZ8vgaSUrCsB5PS5zWtcfTY0UmBwGsKq1Xl0sY6zrhQqg O2u01L10tDfCLqUokrv372DGqDCMM/wrwEbQ3zHLml30+JXdWaIlqBTyEdsmgeniEnbq oEvIVjtpLK0LmAse6TsnBEbAjc2MZNMW31B5tymVrnYpyqHLq7hunLvl4lD4Jauhg4Px scOpNYWhfEVmbaJ5s1dqQcyrbAlc4UBGUrhEpIm/tQkKI7P/Qk8WNphImqdUS1IsP5xA jBL7dntbchvV7YlpdYsSkMsaiMsXn/wrZ6tTFkHMk0CevyRr5MXns8TW530aFsH5oMdD HtIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696968266; x=1697573066; 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=Dsgx0xQPge+9HmU8GeSr2i19e9kEWopqk+L20TkvvHU=; b=XahrUUOxLKtWF0umHQftyUDnsW6KUf7R2Pxgw7dbE7CO1504JxmSdJ25EfwcBqb/cQ 7etPgz5NlwtKBnQ9acTGhadSR11Css4VZ5Ep7b++VrIUP3UICCawHgRvcaxFZyViGRh7 rmP0RJRvNdlk6mELPoLBgwyiAhi9TKsQgrGKkXVgmTtjefFPfnm3P7dyauUicpxdFVkd DWlLxtR0Vq2UspMxXJLR74CzlPi/qlyWh9jluxcbahnEDN+opUC3aOFTSwf5tQIobidT +hipCRgIGefeZuOACElODGw2qMp/zVAvzAjFizcL5ZsLllXqHEBSDaNu58JuBh4ip82I z8QA== X-Gm-Message-State: AOJu0YytAsJtwCCmWBhHA+tr2kzHGSs0P9FgBfMTgIFHgBXK6FTJfQY6 TaIrdPHK4JVENIpKz4FUwnKzHc3rSTAmJlNIZnwC+gVk7feSlqdmvxc= X-Received: by 2002:a81:b71f:0:b0:5a7:aa83:9fb with SMTP id v31-20020a81b71f000000b005a7aa8309fbmr4756178ywh.0.1696968266581; Tue, 10 Oct 2023 13:04:26 -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: Linus Walleij Date: Tue, 10 Oct 2023 22:04:14 +0200 Message-ID: Subject: Re: [PATCH RFT v7 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors To: Bartosz Golaszewski 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=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Tue, 10 Oct 2023 13:07:59 -0700 (PDT) X-Spam-Level: ** 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, GPIOD= _ASIS) > GPIO_HOG("pxa-gpio", SPITZ_GPIO_LED_GREEN, NULL, GPIO_ACTIVE_HIGH, GPIOD_= 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. Yours, Linus Walleij