Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp143024rdb; Fri, 29 Sep 2023 21:26:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+OU2NdQAtpglDImaQJDnI/7hS2v7B0cojfPXxaccz4uQHndkJECHxk+w/zJ5tuhei7Dl3 X-Received: by 2002:a05:6358:4414:b0:141:51d:4d48 with SMTP id z20-20020a056358441400b00141051d4d48mr5965753rwc.17.1696048015091; Fri, 29 Sep 2023 21:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696048015; cv=none; d=google.com; s=arc-20160816; b=Uuz6fSzEs3UQe4ZF5q6MoBms2h7Ww4sT5qn3n30xvqif5o/B2cDIHJEXrv9jbtZeYN /Tywns6jq3MiHpfy6Fxp2NEUDuUC0IayrwYG37S/yQPF78cZMMauDgvBxXJEix23wyib Uk8o5H1W8cZFnpKF1/XRv5iXXU9U9KPC73/ONV9Pdil7hgPBoctWLbWWzctHk/HC06km oIQ84f7mGntfr4E3xJsbijcDTFS+kHqEfOR2ymCA9JdYOwE5+M689FKpGAlpgkBU3d2v WqDyYM190M5uBS9103ZGnG3da3tvFjpRsEZKJShPr3k0MuvmgFlEcnv57eUFb1CuH0Ft 3ngw== 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=0PB3in7uQxQJMooXEXWpiBaHwk+ekocGtELm1zz7ac4=; fh=IIJLJvfDf0sOojs8Z+3ItNVYYPMcohNYYAHbHzIxqc0=; b=JWumlzK69RWs+OSYaTo4Y7k6jTT8AfQo4nsjbyEkFCf69aQdmTfVmklI9MOrEzfJrl 6I/omsAbiib5TK+j3rzIzwPhyqsZ/ReELRS0BE/OToO4ku6tDW/3qj/sc7Zs+/dOznL5 KXY920LJOSkhJV+qYF+Y29XZDfMDIHgANxwA6RSUoK1LzH15PdSc8oJVU0XHqOV8XsW8 nQ91Y2KZtncXWI3CKNBnMGhOVMx1Asxq6q/eoflhyFS+5pCGfJSfh2ja61S+G4/xQl+m R5wl6vZy6F5hEnG4IfyAvS6sx9FhlXDe4zqmG6yeOQ25wi9HEnpm9K/UxfxG8/35mTEG xf3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U+3jJ0gK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id lx8-20020a17090b4b0800b0026b7c4eee42si3203241pjb.66.2023.09.29.21.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 21:26:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U+3jJ0gK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 30D7A8353F45; Fri, 29 Sep 2023 13:48:53 -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 S233884AbjI2UsU (ORCPT + 99 others); Fri, 29 Sep 2023 16:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233753AbjI2UsR (ORCPT ); Fri, 29 Sep 2023 16:48:17 -0400 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23E0C1AE for ; Fri, 29 Sep 2023 13:48:16 -0700 (PDT) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-5a1d0fee86aso107385647b3.2 for ; Fri, 29 Sep 2023 13:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696020495; x=1696625295; 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=0PB3in7uQxQJMooXEXWpiBaHwk+ekocGtELm1zz7ac4=; b=U+3jJ0gKkYUho3gGmo88xldu9TJkA1CeWbLN6HTCIqW5mV1hQqFWK0XqN3lvN+ZMed /03R+MVkn/T25onIUeUtupXjNBoRNrZad4lqXb8xl5FdLo6ryTLVF9sCvD2SVPqZO5MN DvtFj4+5tFKF6OXQp6jzMKSOEV47nVCVnGqyFVjbOIbFksJQeyciKt+uKG53N6FZ0/iM GDGifjx7/jNpVpPguiJqoN7a+dkqrlYPuf7EQIYEfi0TgRtbg2QkFTOyMOb2/OsTw5+M DUhtfzEqqOyDKFmrVCw9W9Cjzea+6qYXomi4zNsvmCUXpnUAhozJ7r3qkw5bRhz06pty l21g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696020495; x=1696625295; 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=0PB3in7uQxQJMooXEXWpiBaHwk+ekocGtELm1zz7ac4=; b=N9dBcca+xvLq4S4yhNwxUAoTbWY6RaYgyT87GTQa7wx3YYbF7+tGdRI1Lyka5gKrgt 7EFF1BzQFpqK6mu5TxzVBS+zrph57tpU1Yb9CtVpI3ch5+l1c2TJMmpkmUS1cs7g32au wwnATsOqvfM/e9qmZLHm3EtLd4dJeWeOfShVTPzS7/Ejq2SdN9FaEnOwisBcSxEBLl9b uLxdnOClbHzU5Qssb2Efvs9nWyFaM5f41H6L9f1H1hdg4+Izaanhg3sLJre9eXai9uis Zdecyx7heUC0IqSOUDlIpGhHVoMdr5kmksZrKJuVPA9F4ei3F1U0GeuAWvhOa8aO7yhu QAhw== X-Gm-Message-State: AOJu0Yz/czTpzpIcIcELU8miO9hA8FvuDn01pPZz4sXyHhfIBp4ZBWH6 96SY+yxn+7lBdKBSbYNXbEnPfQGLRvsBO8JY0E3ylQ== X-Received: by 2002:a05:690c:f8e:b0:5a2:4fd3:d05 with SMTP id df14-20020a05690c0f8e00b005a24fd30d05mr2158753ywb.31.1696020495343; Fri, 29 Sep 2023 13:48:15 -0700 (PDT) MIME-Version: 1.0 References: <20230929-pxa-gpio-v3-0-af8d5e5d1f34@skole.hr> <20230929-pxa-gpio-v3-2-af8d5e5d1f34@skole.hr> In-Reply-To: <20230929-pxa-gpio-v3-2-af8d5e5d1f34@skole.hr> From: Linus Walleij Date: Fri, 29 Sep 2023 22:48:04 +0200 Message-ID: Subject: Re: [PATCH RFC v3 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 , Bartosz Golaszewski , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Fri, 29 Sep 2023 13:48:53 -0700 (PDT) Hi Duje, thanks for your patch! On Fri, Sep 29, 2023 at 3:15=E2=80=AFPM Duje Mihanovi=C4=87 wrote: > Sharp's Spitz board still uses the legacy GPIO interface for configuring > its two onboard LEDs. > > Convert them to use the GPIO descriptor interface. > > Signed-off-by: Duje Mihanovi=C4=87 (...) > + .table =3D { > + GPIO_LOOKUP_IDX("pxa-gpio", SPITZ_GPIO_LED_ORANGE, NULL, = 0, > + GPIO_ACTIVE_HIGH), > + GPIO_LOOKUP_IDX("pxa-gpio", SPITZ_GPIO_LED_GREEN, NULL, 1= , > + GPIO_ACTIVE_HIGH), This looks right! > + gpiod_add_lookup_table(&spitz_led_gpio_table); > + spitz_gpio_leds[0].gpiod =3D gpiod_get_index(&spitz_led_device.de= v, > + NULL, 0, GPIOD_ASIS); > + spitz_gpio_leds[1].gpiod =3D gpiod_get_index(&spitz_led_device.de= v, > + NULL, 1, GPIOD_ASIS); > platform_device_register(&spitz_led_device); I missed this before, sorry. This will probably not work. You need to register the spitz_led_device first, then you can get the gpiod:s. The lookup will use the device name to locate the device, and if the device isn't there it can't be found. Yours, Linus Walleij