Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2234920rdh; Tue, 26 Sep 2023 17:43:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9MfBA5ISlAgkmMQWBd/XfLgR5Tw0oHcUMADrj1U1TThr8e/Q21fGJUOqSw7RAoARTV2pe X-Received: by 2002:a05:6808:23c7:b0:3a9:9ce5:83a9 with SMTP id bq7-20020a05680823c700b003a99ce583a9mr758041oib.50.1695775430922; Tue, 26 Sep 2023 17:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695775430; cv=none; d=google.com; s=arc-20160816; b=mMawpmcUfkFg6Hb5zMFBTCErIRWLu+8GpaOhW4e1Dn68b2AJOGfexpYPxGIEGLgA+s n/KV5NRSECBFbwltqBs7rvHIiesNbveqelEByzhqv+mGBBJkB+8e58xB37xIjHXKvtmJ 4HePtA8TGmYxUAmx2FvmMXjJlBX+GA/H5c4CMG5w5tqEo7rTWxDJY8FGQHUTzrvNurAM uGCFDd3y3Z4+W85fXrnoEzZJ55NBEC+BQrtAGZdT4+WhngS3k6Ps0pHlRXaCbSPqGOGC NAjeKCTaIv/ohp+DaTBuAJbc8OqYtwtPsiPK9KjUzf9labglo6ikR4v+8hKyo4g3atOP nH8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LOR2X/AoUnTx42nPhZDbyArkpmdX3bsMYj2lZRsFUms=; fh=Tss7K8NVbsMYNZ1fG9jf8bECM8zIrRfQ37piI3ZudAE=; b=sjoQYZdvXI5uY4ETaYgLvGyNZtoTPzeW9PxboMHvkPKvvhP+0NspnXhTXW9ZNhM1W0 7HBWaWsPf7Xp6UXMJrPambvA75A12s382g3ishyupgPe4SM3EmYhd1VP5VnnOxHEXz2a l8CCqP5zx2NPfYvfeYUoJmNMwcOL6VGWYGEF4DWshF/If76gdxTK+HVqH8Yc7YBAMPiU fV6iRNPGGolBiYtGy50XSKy09AamS7ZoQ3o8AxXF0o1JXQADF8RRnI5crQPyrAsPjI8i 1RMsWY3jVDkVsNRLrE8PQoM3n9bHLofUw9ONasQB/nhNn6gfHUe+eGnsK4bu4AFYKBrc owDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=zOZwMSAX; 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 eb27-20020a056a004c9b00b00691019fd0efsi14351505pfb.75.2023.09.26.17.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 17:43:50 -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=zOZwMSAX; 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 18C3080CE7F9; Tue, 26 Sep 2023 08:00:11 -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 S235004AbjIZPAG (ORCPT + 99 others); Tue, 26 Sep 2023 11:00:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234996AbjIZPAB (ORCPT ); Tue, 26 Sep 2023 11:00:01 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF8C7127 for ; Tue, 26 Sep 2023 07:59:54 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-32336a30d18so1508785f8f.2 for ; Tue, 26 Sep 2023 07:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1695740393; x=1696345193; 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=LOR2X/AoUnTx42nPhZDbyArkpmdX3bsMYj2lZRsFUms=; b=zOZwMSAXHjeLQGWcL2Uhltnz2hlI7XNV9ewI0AYTJIyufx2fw5+odUKZX3SF3OdVo2 UlQEE0zam+rMuUY+dmj78myXlrMmWSkfn37NQb+yQn2yRzuAYt1mHQeX69fRpj3LWgoq DnRkDh1CFa3VtNEjAJi12cVCeQPSzMIuLFEBnrWlbPdaoXkN0akjsISOdCiNgMPoHRLF r7kNO0MescDjiY5P31lLEnDKROy/OtDt6ZI8ox9V10HkOMJPo00rSnEjLYDdN9ij1f9G l36r3oZGDy/tqplSiP6d6VejCSKVhHopDn8QC2mOJlzpGtJlbgtq+H3NJEoLoy5x/ooi jU0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695740393; x=1696345193; 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=LOR2X/AoUnTx42nPhZDbyArkpmdX3bsMYj2lZRsFUms=; b=GDKlnZjSkY7mE15XLtRf76hlWCNPpmAe9M1h415Lfhxhd4S0hf1hoZ7j0H+uG+6/k7 vryjlOfuK8aKJI/hZ5+8b0NLJunyIXRIISC7IHbose6ZVsULC+nmpZGphhIshAVyf2Gf TLTu+vcTDqntwsxwJUpbQGLE+9fnu5/u0dYCkDYltE2hjmVtcJkCuekX8YdAiHtKB0CF AVRjZmJFXGYxgDnr7s5KlQcdz4xbmxXbM0sztWiE4Ip9SSWPbZKP+Mtf5jdrUf56A6iL wY3c1LZbzjdghlsaJwF8NrP5Tq00jJup2YPcS2XGc8R4/KE3zItUjanW24OaeiQ2KPyI 1UqA== X-Gm-Message-State: AOJu0YwRP19T/N0Oo22/IwgJknmpmpfspHwc79OwW0H26baDUhNy7J+/ 875+Zv5e46xm6n4j3Oa3uKRfLw== X-Received: by 2002:adf:f044:0:b0:319:7134:a3cf with SMTP id t4-20020adff044000000b003197134a3cfmr9483453wro.31.1695740393042; Tue, 26 Sep 2023 07:59:53 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:686:c497:30b1:d2b9]) by smtp.gmail.com with ESMTPSA id s2-20020a5d5102000000b0031f82743e25sm14871634wrt.67.2023.09.26.07.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 07:59:52 -0700 (PDT) From: Bartosz Golaszewski To: Mika Westerberg , Andy Shevchenko , Linus Walleij , Daniel Scally , Hans de Goede , Mark Gross Cc: linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, Bartosz Golaszewski Subject: [RFT PATCH 2/4] platform/x86: int3472: led: don't use gpiod_toggle_active_low() Date: Tue, 26 Sep 2023 16:59:41 +0200 Message-Id: <20230926145943.42814-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230926145943.42814-1-brgl@bgdev.pl> References: <20230926145943.42814-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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]); Tue, 26 Sep 2023 08:00:11 -0700 (PDT) From: Bartosz Golaszewski Instead of acpi_get_and_request_gpiod() + gpiod_toggle_active_low(), use temporary lookup tables with appropriate lookup flags. Signed-off-by: Bartosz Golaszewski --- drivers/platform/x86/intel/int3472/led.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/led.c b/drivers/platform/x86/intel/int3472/led.c index bca1ce7d0d0c..62e0cd5207a7 100644 --- a/drivers/platform/x86/intel/int3472/led.c +++ b/drivers/platform/x86/intel/int3472/led.c @@ -25,18 +25,14 @@ int skl_int3472_register_pled(struct int3472_discrete_device *int3472, if (int3472->pled.classdev.dev) return -EBUSY; - int3472->pled.gpio = acpi_get_and_request_gpiod(path, agpio->pin_table[0], - "int3472,privacy-led"); + int3472->pled.gpio = skl_int3472_gpiod_get_from_temp_lookup( + int3472->dev, path, agpio->pin_table[0], + "int3472,privacy-led", polarity, + GPIOD_OUT_LOW); if (IS_ERR(int3472->pled.gpio)) return dev_err_probe(int3472->dev, PTR_ERR(int3472->pled.gpio), "getting privacy LED GPIO\n"); - if (polarity == GPIO_ACTIVE_LOW) - gpiod_toggle_active_low(int3472->pled.gpio); - - /* Ensure the pin is in output mode and non-active state */ - gpiod_direction_output(int3472->pled.gpio, 0); - /* Generate the name, replacing the ':' in the ACPI devname with '_' */ snprintf(int3472->pled.name, sizeof(int3472->pled.name), "%s::privacy_led", acpi_dev_name(int3472->sensor)); -- 2.39.2