From nobody Sun Nov 24 16:37:04 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF9131AD3F6; Mon, 4 Nov 2024 09:36:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712983; cv=none; b=CDjZ6XQHoUMF8MKwDwRzLE75UnMLvUWBl7qxrVji5cpCwHhaAzrhzkoEk/NYQR/+OOvPS/ooCvsBmbiiG5jbrOplUleMjKkoi+QrFl5hZha5AmiEkZiTUuxB7qP+xwiBJNGguKDDRy18oAz8x62+L0uGnudI3RFRu+W/AUIbklI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712983; c=relaxed/simple; bh=nwoZv6RI/t7WIQO+Llzq3vqo716xkyZTrrmxMQ1Qo5A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rkSItogI8K5FvjfkET94Twmy8UnqWaq24362sIe07HtUaZKZsdvClgpfUhcNv4p5RR8ZiqenRqumMDoNlTN1UO954fYNLn910KNx7BenzLImwoQpnyV9YNSnOzsIe2QPKj4euxuZNA7pwCynmYs155FyADIXCiE3QT5wIPklDGU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=XTOinAKC; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XTOinAKC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730712982; x=1762248982; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nwoZv6RI/t7WIQO+Llzq3vqo716xkyZTrrmxMQ1Qo5A=; b=XTOinAKCF0sm8Q7mGXbztYkT/mypycJn/Qw1AxDCSSaUUeflCC4iV9I6 95eRbyVGJSdTQNsFHw4vcMXLjWelHlEIUCRY4AEr+M16vpeRihzBJ7Yiz 4GC/nV0tsSxYYu62/PVS6wj3whlE3zxEW848u039DJRPp2nlQC/B/oc5Z UGBGxIrn12VnVOhDuuETmyGyB+hdp9FT4d2bGCX/jOhpdYJ08d2fFXRLB 7FrddnUGMnVS9l87Bl/gqSvIm3SLt2ttk8D9VMuwHNMDFM667NL0Yik8h V49k98Dc9mDuBDBJiXuVGVuadGRbKbGO8URl3+9qVLZhdSS0UZw6RhAgw Q==; X-CSE-ConnectionGUID: HacooeagS1WdldGSSHEfYA== X-CSE-MsgGUID: mW+ecpHkSdC1bOs+jioDdQ== X-IronPort-AV: E=McAfee;i="6700,10204,11245"; a="30620067" X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="30620067" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 01:36:19 -0800 X-CSE-ConnectionGUID: MYYv3+lJR1OEQqIJMobIIg== X-CSE-MsgGUID: u/T5IgnnRf6ay5P0MC8VNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="83127054" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 04 Nov 2024 01:36:11 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9F70B17D; Mon, 04 Nov 2024 11:36:10 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Dmitry Torokhov , Tony Lindgren , Lee Jones , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Dominik Brodowski , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Greg Kroah-Hartman Subject: [PATCH v1 1/6] Input: gpio_keys - avoid using GPIOF_ACTIVE_LOW Date: Mon, 4 Nov 2024 11:34:19 +0200 Message-ID: <20241104093609.156059-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> References: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Avoid using GPIOF_ACTIVE_LOW as it's deprecated and subject to remove. Signed-off-by: Andy Shevchenko Acked-by: Dmitry Torokhov Reviewed-by: Linus Walleij --- drivers/input/keyboard/gpio_keys.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gp= io_keys.c index 380fe8dab3b0..5eef66516e37 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -531,12 +531,7 @@ static int gpio_keys_setup_key(struct platform_device = *pdev, * Legacy GPIO number, so request the GPIO here and * convert it to descriptor. */ - unsigned flags =3D GPIOF_IN; - - if (button->active_low) - flags |=3D GPIOF_ACTIVE_LOW; - - error =3D devm_gpio_request_one(dev, button->gpio, flags, desc); + error =3D devm_gpio_request_one(dev, button->gpio, GPIOF_IN, desc); if (error < 0) { dev_err(dev, "Failed to request GPIO %d, error %d\n", button->gpio, error); @@ -546,6 +541,9 @@ static int gpio_keys_setup_key(struct platform_device *= pdev, bdata->gpiod =3D gpio_to_desc(button->gpio); if (!bdata->gpiod) return -EINVAL; + + if (button->active_low ^ gpiod_is_active_low(bdata->gpiod)) + gpiod_toggle_active_low(bdata->gpiod); } =20 if (bdata->gpiod) { --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Sun Nov 24 16:37:04 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E40F1ADFE2; Mon, 4 Nov 2024 09:36:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712983; cv=none; b=AieqM1hRd/mHRmIrRLBsukYwDDUCfK34ohphai7qITuEOmGFSXLAnAh8BrHHhH7OnDpaP689SAY2srme47N1s7V2nwAhXTI21sfzYFyXN037mN/OcyYYCx0Z5My/2Ees1YI/wJfRCobsOJfp1QoFDhtDc2inDKMGG5hSK/h0TZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712983; c=relaxed/simple; bh=kUCUIekHAy2hQVeY+KDx2ZmkPhmDOVUUdVI2qaPtf0A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TzRwS9ZWZ7M18UlCZSiSkye8frDm8445WsaXmbmRYh6VKJUIcCn/qPL+GsvOwYt2Kqhwp9sQf7fOpnjJfYZvxVtUNGwmyGhAw+wI3KFm91JCENPajxIEzwhZxDNN+HA7DalmoI6Z0ecp6g4qWuq3ffVVVKHAFqFwDqW1D95/8vk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UBktejPa; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UBktejPa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730712982; x=1762248982; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kUCUIekHAy2hQVeY+KDx2ZmkPhmDOVUUdVI2qaPtf0A=; b=UBktejPaI/zFLOeLkY9Ms2qREZeAkHOZFas4aVttu9PULi5fkpRhNR3a LkekdJqNAhryBaT040G6kp+++fnQ8Mm1rhSEl1hKDD/5PIGI8WOWqqRxn Pzfn/hSAjFl53w9z4CHvQTFR4aYZmyuvXvhbH+1OHj3bICfe8HJlTQtpZ TjMe/ivE7CiBN4f7/VVjQvW8Wqtls56tnGz9/bI0PnK9eF39jWIt0zpJK 2nYu1TaoV1A8oronWNok0JzbVZH8McVc/F5Bqn3lfButOSIfL1qUH2ChE bBC9nK0xTUtUrFNo0gu0ACQEqOH9SCtAIlrJdOLFSZgi323xT99oGdBV7 A==; X-CSE-ConnectionGUID: CJj6V8J9TH+QxhcTqQHLMA== X-CSE-MsgGUID: S0qxHZ17SxC8ZzvLHbCopQ== X-IronPort-AV: E=McAfee;i="6700,10204,11245"; a="30278749" X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="30278749" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 01:36:16 -0800 X-CSE-ConnectionGUID: hvVNDrAtT+ibO2wGuf0PZw== X-CSE-MsgGUID: jao+gc8dRpqEnOSD9mauAA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="83481189" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa009.jf.intel.com with ESMTP; 04 Nov 2024 01:36:12 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id AD59626A; Mon, 04 Nov 2024 11:36:10 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Dmitry Torokhov , Tony Lindgren , Lee Jones , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Dominik Brodowski , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Greg Kroah-Hartman Subject: [PATCH v1 2/6] Input: gpio_keys_polled - avoid using GPIOF_ACTIVE_LOW Date: Mon, 4 Nov 2024 11:34:20 +0200 Message-ID: <20241104093609.156059-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> References: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Avoid using GPIOF_ACTIVE_LOW as it's deprecated and subject to remove. Signed-off-by: Andy Shevchenko Acked-by: Dmitry Torokhov Reviewed-by: Linus Walleij --- drivers/input/keyboard/gpio_keys_polled.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyb= oard/gpio_keys_polled.c index 41ca0d3c9098..e6707d72210e 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -306,13 +306,8 @@ static int gpio_keys_polled_probe(struct platform_devi= ce *pdev) * Legacy GPIO number so request the GPIO here and * convert it to descriptor. */ - unsigned flags =3D GPIOF_IN; - - if (button->active_low) - flags |=3D GPIOF_ACTIVE_LOW; - - error =3D devm_gpio_request_one(dev, button->gpio, - flags, button->desc ? : DRV_NAME); + error =3D devm_gpio_request_one(dev, button->gpio, GPIOF_IN, + button->desc ? : DRV_NAME); if (error) return dev_err_probe(dev, error, "unable to claim gpio %u\n", @@ -325,6 +320,9 @@ static int gpio_keys_polled_probe(struct platform_devic= e *pdev) button->gpio); return -EINVAL; } + + if (button->active_low ^ gpiod_is_active_low(bdata->gpiod)) + gpiod_toggle_active_low(bdata->gpiod); } =20 bdata->last_state =3D -1; --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Sun Nov 24 16:37:04 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FA8E1AF0A0; Mon, 4 Nov 2024 09:36:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712985; cv=none; b=rV3apjAV4LK5N8AeW1PzHHCXM6lhhLt0g+ERP1j6yrz9djezu2pSj9OIWXe6CttnZ+Rsg4Yl5WSDYxETQhIUg8/VbSUHgeM9e6lnF6BKLZlhzO+liKnT/GFusJHvKXYzxGyimR6BSF2ceSrcgUxXpa1CqrS5KlUXP44U5FU0naI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712985; c=relaxed/simple; bh=vZMtd1T590YnZLPRvMitwgFNTD+hNyBhf6P6IUabJ8s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mnm6nYjiqztV0THzz2hCe0qylcGraGIZSfLcIuLDaz23HLdG3Oe0nxCbNe34FcHcBFBrEv+NI30ER8cb4JNtRqdFvzGkO7U9esfCCBJcwgLNR1WVHbaG0rvhbt/byFtb73/mlkn6/k7sepvKzL9LDbRkWuIqKq4Q0ISkU5VYoQ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KGpRmAl8; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KGpRmAl8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730712984; x=1762248984; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vZMtd1T590YnZLPRvMitwgFNTD+hNyBhf6P6IUabJ8s=; b=KGpRmAl8pl+DBl2o9QsdZ3MijTvr5+mCAqiewO3RiIFNJcnSDTnNYPly jcNsexOK8TUqoLRWN+7fkEQG/mwYEQTnGR6U1AmbGul8+QTbHSEbmA0Nl l4jdAPZaQzoz0MaJWvZN7NZQl7KuW7fENEYyAxHIxQdD57XvU5pDuKn2N 2savxXY2uz+abdeQeVATA3ygbg6oZS+UAfFldXqmOq+/fX6nALIs7U64z xdhG6kcG2JvFfFgMt7PSTxbF0epMLJIuf61tmALyIiDsTCrmeXHBXfU1q 6Jxj46M5ZVwwJgYId3hiT3jpTTTFA+MvQE7usdiQ28EL9OMQa92+V4FKr Q==; X-CSE-ConnectionGUID: xN4R/pzXQ7uiptUfJWuC2A== X-CSE-MsgGUID: YSV/pTB2SbKXdNqD2X7VHQ== X-IronPort-AV: E=McAfee;i="6700,10204,11245"; a="30620090" X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="30620090" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 01:36:20 -0800 X-CSE-ConnectionGUID: UCIDPEfhSVKAFG44XKPZtQ== X-CSE-MsgGUID: 697U+mSATYmDf45+hbnpFA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="83127055" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 04 Nov 2024 01:36:11 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id B69AC320; Mon, 04 Nov 2024 11:36:10 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Dmitry Torokhov , Tony Lindgren , Lee Jones , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Dominik Brodowski , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Greg Kroah-Hartman Subject: [PATCH v1 3/6] leds: gpio: Avoid using GPIOF_ACTIVE_LOW Date: Mon, 4 Nov 2024 11:34:21 +0200 Message-ID: <20241104093609.156059-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> References: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Avoid using GPIOF_ACTIVE_LOW as it's deprecated and subject to remove. Signed-off-by: Andy Shevchenko Acked-by: Lee Jones Reviewed-by: Linus Walleij --- drivers/leds/leds-gpio.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 0d59b0bbc002..a3428b22de3a 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -212,7 +212,6 @@ static struct gpio_desc *gpio_led_get_gpiod(struct devi= ce *dev, int idx, const struct gpio_led *template) { struct gpio_desc *gpiod; - unsigned long flags =3D GPIOF_OUT_INIT_LOW; int ret; =20 /* @@ -239,10 +238,7 @@ static struct gpio_desc *gpio_led_get_gpiod(struct dev= ice *dev, int idx, if (!gpio_is_valid(template->gpio)) return ERR_PTR(-ENOENT); =20 - if (template->active_low) - flags |=3D GPIOF_ACTIVE_LOW; - - ret =3D devm_gpio_request_one(dev, template->gpio, flags, + ret =3D devm_gpio_request_one(dev, template->gpio, GPIOF_OUT_INIT_LOW, template->name); if (ret < 0) return ERR_PTR(ret); @@ -251,6 +247,9 @@ static struct gpio_desc *gpio_led_get_gpiod(struct devi= ce *dev, int idx, if (!gpiod) return ERR_PTR(-EINVAL); =20 + if (template->active_low ^ gpiod_is_active_low(gpiod)) + gpiod_toggle_active_low(gpiod); + return gpiod; } =20 --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Sun Nov 24 16:37:04 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36CA41AE017; Mon, 4 Nov 2024 09:36:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712985; cv=none; b=esJ5chVpqTthca5oGnPgFe2asJAD1TnedEmVcarGtkykx/nNUTE0EHVsttLKIqUc0IUeOk8Y4Tx1kcFaxFubbNelMIq8RO+mzjPoLivz/kCAODjl1kUT96IRim/ShO4i4eFlsJ44yq8DqdI0vjxd6fVlaECzDpFHII0btOJAJtQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712985; c=relaxed/simple; bh=l2TSS11EQDCPbhJt567UVr2avTbDJtRucAlK/U+ezRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nCEqkVeFTb62kuEAn54eQGvgsnKLiJ4EdAQUQZM/AaN2mgIZI9RjFNSkVN745HoSEHsn9EX7/968bqaAhHRy1RutLq0+SmEdh8x2S+Hi9hqoJ4n9GuAjFB6ATeeghLQcvfb/N8sKT0fuSY2DxX3J0RbAa8DM5KQcqFFbmqHvgBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=TimKwjZ1; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TimKwjZ1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730712983; x=1762248983; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=l2TSS11EQDCPbhJt567UVr2avTbDJtRucAlK/U+ezRY=; b=TimKwjZ1wM5h+HL8IEM/rdxC+6WLsAudSTCeYngSbxkgBlR7W96pP3tn TlMkgiMnMyUBHG2i5Bnn7GAoLhjmF1Y3D1WYCzMOy0wvmyV1wNo2OaT2I uARQ27HMrBFf5UsM/jkuzGcshrZYbQ2My+cubuKhNwz4DozdFM4Sy7j1l FkZm5jAE2QFaDJ5d+Muhp2QjRkuZz+itMQzuJY7tNnP1+iqltmazc/VdH uVjUvAUPnSBorj7prprlYyjfGIwFOpopeo3UciD7PUytb9QfNX6Wc5P03 uPDEFZhKmlm1v9skL60Eolw1o2oD/a8/Dwk6E3JQG8KV1VJZPzrqZhvth w==; X-CSE-ConnectionGUID: fZEsy/grTSWVrbbGITEKfw== X-CSE-MsgGUID: mVzZHhU5QPOsYOkazyip0g== X-IronPort-AV: E=McAfee;i="6700,10204,11245"; a="30278761" X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="30278761" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 01:36:16 -0800 X-CSE-ConnectionGUID: xcETve/0S9Oi+37Ks/vMog== X-CSE-MsgGUID: 5KT7PbBBRW6rQeZEXFrhbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="83481190" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa009.jf.intel.com with ESMTP; 04 Nov 2024 01:36:12 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id C48AB3B4; Mon, 04 Nov 2024 11:36:10 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Dmitry Torokhov , Tony Lindgren , Lee Jones , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Dominik Brodowski , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Greg Kroah-Hartman Subject: [PATCH v1 4/6] pcmcia: soc_common: Avoid using GPIOF_ACTIVE_LOW Date: Mon, 4 Nov 2024 11:34:22 +0200 Message-ID: <20241104093609.156059-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> References: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Avoid using GPIOF_ACTIVE_LOW as it's deprecated and subject to remove. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/pcmcia/soc_common.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index 61b0c8952bb5..1deb9960db34 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c @@ -204,14 +204,8 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket= *skt) =20 for (i =3D 0; i < ARRAY_SIZE(skt->stat); i++) { if (gpio_is_valid(skt->stat[i].gpio)) { - unsigned long flags =3D GPIOF_IN; - - /* CD is active low by default */ - if (i =3D=3D SOC_STAT_CD) - flags |=3D GPIOF_ACTIVE_LOW; - ret =3D devm_gpio_request_one(skt->socket.dev.parent, - skt->stat[i].gpio, flags, + skt->stat[i].gpio, GPIOF_IN, skt->stat[i].name); if (ret) { __soc_pcmcia_hw_shutdown(skt, i); @@ -219,6 +213,10 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket= *skt) } =20 skt->stat[i].desc =3D gpio_to_desc(skt->stat[i].gpio); + + /* CD is active low by default */ + if ((i =3D=3D SOC_STAT_CD) ^ gpiod_is_active_low(skt->stat[i].desc)) + gpiod_toggle_active_low(skt->stat[i].desc); } =20 if (i < SOC_STAT_VS1 && skt->stat[i].desc) { --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Sun Nov 24 16:37:04 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACA701AE01F; Mon, 4 Nov 2024 09:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712990; cv=none; b=Cljt9+64fMosPCc+cZqC6q+4YjJhTy3Blza5ignzo6YeMlKT5DrkbcWvnBJ6jsM1SNaJgCX52U3TM0lHChDZFlOHN7ClA9U5fg4+KxWH3B/imzQ7JNmy2So4sexh5KfCT0ZdZ2gdeFRdWhhqjalp1VJJ4CRCWfGyXM1U7Jq0/MI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712990; c=relaxed/simple; bh=Sc+eqveINCgjfeZ/XCA8LOsWGvrDOO3Z75MHxHV6gP0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mt+RPlEdvCZsyLcedYLWecW1tqWl4Unb0QTaHpo6LVY2MBYXq+g/UWw9gFthakmBjcDBSW6LQBQai2XenkMd/jYj2HJQkC9W1B/ZDtZA7wwZExRtelWTeqaI5LOeX6OoSw5bdhZXfxJUnUQbfn6a+gku6MkdfMGr4+WmQeyv9Zc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=cmsGN5d0; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="cmsGN5d0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730712989; x=1762248989; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Sc+eqveINCgjfeZ/XCA8LOsWGvrDOO3Z75MHxHV6gP0=; b=cmsGN5d0H45SlHE2iorkOF4oDGsx0dkzWCvZqWymjaX6giruS7iDSnAt CLQeiOMSud5hKCG4ejQ1CoV7brTpn+ImUgZ1LFZzc1B3oDIhFN2yK1XCL Tfq0Uk1CkFTzQCYjg3gKgzUaTKLhXoFMpy/uiOKvXph4YsEsW6uVlN08L P7rYVvL2ERf+KTF7dhEtFYCJ9amvHXn4qQoZIT1tlAMmJ+KFCpjGGbfmh zV9TEK++pm0l+8YuU82ygtvMYhptdflipxeQl7PP38Ug2ZjIXbUI2UgtB zAP02g5A7uR3Fwxvb8Na1wDPxf/+J/wnf2B4TJpqPJDGAtOR1tKk9ii4M g==; X-CSE-ConnectionGUID: fCGnczMRShubdAUWnlhnBA== X-CSE-MsgGUID: tuH0gCZQQwWibhfRlgAwSA== X-IronPort-AV: E=McAfee;i="6700,10204,11245"; a="30620092" X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="30620092" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 01:36:21 -0800 X-CSE-ConnectionGUID: Ah+BKPYZTaqhFdk5MbXoWg== X-CSE-MsgGUID: 7yc422SjSi6VFqbnsmzs9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="83127064" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 04 Nov 2024 01:36:16 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id D17216CE; Mon, 04 Nov 2024 11:36:10 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Dmitry Torokhov , Tony Lindgren , Lee Jones , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Dominik Brodowski , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Greg Kroah-Hartman Subject: [PATCH v1 5/6] USB: gadget: pxa27x_udc: Avoid using GPIOF_ACTIVE_LOW Date: Mon, 4 Nov 2024 11:34:23 +0200 Message-ID: <20241104093609.156059-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> References: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Avoid using GPIOF_ACTIVE_LOW as it's deprecated and subject to remove. Signed-off-by: Andy Shevchenko Acked-by: Greg Kroah-Hartman Reviewed-by: Linus Walleij --- drivers/usb/gadget/udc/pxa27x_udc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/p= xa27x_udc.c index 7d3a8a5f3796..f9a55d4f189f 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c @@ -2355,18 +2355,19 @@ static int pxa_udc_probe(struct platform_device *pd= ev) struct pxa_udc *udc =3D &memory; int retval =3D 0, gpio; struct pxa2xx_udc_mach_info *mach =3D dev_get_platdata(&pdev->dev); - unsigned long gpio_flags; =20 if (mach) { - gpio_flags =3D mach->gpio_pullup_inverted ? GPIOF_ACTIVE_LOW : 0; gpio =3D mach->gpio_pullup; if (gpio_is_valid(gpio)) { retval =3D devm_gpio_request_one(&pdev->dev, gpio, - gpio_flags, + GPIOF_OUT_INIT_LOW, "USB D+ pullup"); if (retval) return retval; udc->gpiod =3D gpio_to_desc(mach->gpio_pullup); + + if (mach->gpio_pullup_inverted ^ gpiod_is_active_low(udc->gpiod)) + gpiod_toggle_active_low(udc->gpiod); } udc->udc_command =3D mach->udc_command; } else { --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Sun Nov 24 16:37:04 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9719B1AF0B2; Mon, 4 Nov 2024 09:36:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712986; cv=none; b=RxtPXvfuzU+SL6COgLUE+r1Q9ZWAFsqZkyEul+W3eJDQnWRsumyQ5D1MmNDmZOSaDaX4UIGtLc9uMAs3odLpf7fr/ztzHiyIzV1D4vYEzifWeRavmsLm4qI8UadBq0ZGSSLgpLMq/86+AM17ysHQfCFMsxqzoT7k8M6FWvysrKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730712986; c=relaxed/simple; bh=hwe/b3t0fRSiOwM5LgSXyqtmSdkws0uscP6ALDCp0/s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lH0FCKYZx2ifyo+uofDJv7qmKBZztHMo+s9MZGOOST5/CZqVooOWpFztERoDR0RN8H+0BJDPoN7YiAdYeK9ajGuehi+tQfShxgJGwjx6blM1zlrEjWtl6/H3Au76+q52CvgrSBsihv3nKMwrP06+yW+i/5Pbf1nMLVR4z/aj+o0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=PdCINBMY; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PdCINBMY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730712983; x=1762248983; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hwe/b3t0fRSiOwM5LgSXyqtmSdkws0uscP6ALDCp0/s=; b=PdCINBMYVI5gsHEukFi79h89KZ4q5sfxSQWC4iTVuzAjfrmhMqHdBaEa 9o2UEwAk+Y4SAjN4YdgsJO1LPhhkqce/SS97xa3czwWB3p2lzF306eGfk 96UAvk589wJIQmmPaluOVqcOQ5Xl0eYQPTxtfrs497EtQtQgBtQHUpb0b fNuNakDhvMMLR1OKi68Wtvet10kVK384xTTQMyFKt7L2SC0vOBXYfUFFh vHmgA1SUoIOxyY9aYOVW8DktHHrqwVXFNaOdaTbQgEfNo9Q/WOL/TDYkQ Pc2NDeXzAotOM78J7bE0a0+O6g+TYdVoliAdav4svENT82UR2guiq7yjW Q==; X-CSE-ConnectionGUID: 1BqkHAM0RROpjq5Vh/RHcQ== X-CSE-MsgGUID: bJXvU7QpSCmIAdLEjJivpw== X-IronPort-AV: E=McAfee;i="6700,10204,11245"; a="30278788" X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="30278788" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 01:36:21 -0800 X-CSE-ConnectionGUID: s9rewHwKS8eXCZpHso+clw== X-CSE-MsgGUID: nJ4vzYBeTXunQESoKPaApw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="83481194" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa009.jf.intel.com with ESMTP; 04 Nov 2024 01:36:17 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DEBD7740; Mon, 04 Nov 2024 11:36:10 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Dmitry Torokhov , Tony Lindgren , Lee Jones , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Dominik Brodowski , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Greg Kroah-Hartman Subject: [PATCH v1 6/6] gpio: Get rid of GPIOF_ACTIVE_LOW Date: Mon, 4 Nov 2024 11:34:24 +0200 Message-ID: <20241104093609.156059-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> References: <20241104093609.156059-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" No more users. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpiolib-legacy.c | 3 --- include/linux/gpio.h | 3 --- 2 files changed, 6 deletions(-) diff --git a/drivers/gpio/gpiolib-legacy.c b/drivers/gpio/gpiolib-legacy.c index 28f1046fb670..aeae6df8bec9 100644 --- a/drivers/gpio/gpiolib-legacy.c +++ b/drivers/gpio/gpiolib-legacy.c @@ -46,9 +46,6 @@ int gpio_request_one(unsigned gpio, unsigned long flags, = const char *label) if (err) return err; =20 - if (flags & GPIOF_ACTIVE_LOW) - set_bit(FLAG_ACTIVE_LOW, &desc->flags); - if (flags & GPIOF_IN) err =3D gpiod_direction_input(desc); else diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 2d105be7bbc3..6270150f4e29 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -21,9 +21,6 @@ struct device; #define GPIOF_OUT_INIT_LOW ((0 << 0) | (0 << 1)) #define GPIOF_OUT_INIT_HIGH ((0 << 0) | (1 << 1)) =20 -/* Gpio pin is active-low */ -#define GPIOF_ACTIVE_LOW (1 << 2) - /** * struct gpio - a structure describing a GPIO with configuration * @gpio: the GPIO number --=20 2.43.0.rc1.1336.g36b5255a03ac