From nobody Sat Feb 7 18:21:16 2026 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 8382734D38D; Wed, 12 Nov 2025 19:14:21 +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=1762974863; cv=none; b=V7fpTabUINY4MWv0nb15m457dW7PSpBShwLXdgm9wPfmKx096MJsXqgS3380yaP7cqUM1f3uHNCCQGno3CgKTHharioCim85mq3A/X+u9OgMdxF3pF+pbY21K85RHK6SiPYPoEvfb4N9FHIppkcuDuhjh1rCJTWDQnlgDDIyfZU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762974863; c=relaxed/simple; bh=100NIUpe/MmbcoRj+BLsbRqmsAMwdJQoi7KDFZ6HdWg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DbDTE6nqpqr95QLu5G0QUJNyoB1jDwrSoDYqMXdPJzm39I0jFbTfDbwqZv4JI6vrZnCnbf91xXL8ijn1yIVKH6YU1iB827Ds7e+ZD/HD1IN9sR/x7CAGA6K8d7vVx8mxSe3strt/wLRuL6QzoirMmuSpeTTWUy1x1X9uN3MowNc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=mLdNSUfN; 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=pass 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="mLdNSUfN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762974860; x=1794510860; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=100NIUpe/MmbcoRj+BLsbRqmsAMwdJQoi7KDFZ6HdWg=; b=mLdNSUfNm74OMJYx6shE7sRjJD4YasSp1hjtrRbkfhoRFFq58Sjg/BkL scVI/cQjbicKQRkUI7mGyv6sIJa5WDSoID/dtHwKz58g7qmXnll+KdhEq J8phx5Q+qUxQEHSFTJTT52bQLDrVyiPIn7BNQKAAX1VPj1qrJc/vm5O3G GiNcfTjVupOlbfG7opbkXd0CcCJtw1LjkZivdqjy4u89FpxA7tGqv5EZm Ic6uQs298QxbIVNzIqxx/smcubA0kX5NMwCC79jnG5PVM1wCa/88lsVNz cMSzUc8kXmep/mw2iTgP0LUExXsd1b1JbkqTWsXTi6lDnVcht44KVYyP8 A==; X-CSE-ConnectionGUID: 94+BZa18SduZubrr9CEnjQ== X-CSE-MsgGUID: qpfH54ArS+OiBXLzHL6thw== X-IronPort-AV: E=McAfee;i="6800,10657,11611"; a="65086886" X-IronPort-AV: E=Sophos;i="6.19,300,1754982000"; d="scan'208";a="65086886" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2025 11:14:16 -0800 X-CSE-ConnectionGUID: 9f0IlICMTiyHdYUXTrnwlw== X-CSE-MsgGUID: OFpj2LbuTPCO6IPV/aqOXg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,300,1754982000"; d="scan'208";a="219951618" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa002.jf.intel.com with ESMTP; 12 Nov 2025 11:14:16 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id A0C3596; Wed, 12 Nov 2025 20:14:14 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH v1 1/5] Input: gpio_decoder - make use of device properties Date: Wed, 12 Nov 2025 20:13:17 +0100 Message-ID: <20251112191412.2088105-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251112191412.2088105-1-andriy.shevchenko@linux.intel.com> References: <20251112191412.2088105-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" Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko --- drivers/input/misc/gpio_decoder.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/input/misc/gpio_decoder.c b/drivers/input/misc/gpio_de= coder.c index ee668eba302f..459abc749a49 100644 --- a/drivers/input/misc/gpio_decoder.c +++ b/drivers/input/misc/gpio_decoder.c @@ -10,9 +10,10 @@ #include #include #include +#include #include -#include #include +#include =20 struct gpio_decoder { struct gpio_descs *input_gpios; @@ -110,19 +111,17 @@ static int gpio_decoder_probe(struct platform_device = *pdev) return 0; } =20 -#ifdef CONFIG_OF static const struct of_device_id gpio_decoder_of_match[] =3D { { .compatible =3D "gpio-decoder", }, - { }, + { } }; MODULE_DEVICE_TABLE(of, gpio_decoder_of_match); -#endif =20 static struct platform_driver gpio_decoder_driver =3D { .probe =3D gpio_decoder_probe, .driver =3D { .name =3D "gpio-decoder", - .of_match_table =3D of_match_ptr(gpio_decoder_of_match), + .of_match_table =3D gpio_decoder_of_match, } }; module_platform_driver(gpio_decoder_driver); --=20 2.50.1 From nobody Sat Feb 7 18:21:16 2026 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 971D03C465; Wed, 12 Nov 2025 19:14:17 +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=1762974859; cv=none; b=igvMcLFc0Rhuwr/8m8DAHu4/TJYEHrhW6C+zLVKEHHYM4ks4Cln4q0E2iDH2j9vN59z7BP+Cnb23u/Iqw2ePSkSbBX9m9uHhU2oZjlZ4JLFzhSkwwJ3VTIuqBeZudUsr78ErMNd1Dbp+Ussars/OeAGgU6yag8V/2PE8P1ul52A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762974859; c=relaxed/simple; bh=BM3/WsEhx6V4q9gdSQn84p7QgaZ00RWNFD1Rpo6D9Ic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ku7okyM0wneVOh/ZfJjLzGkk31nwx/JsVTe7FliATrinzgK99zG1Kz3PfJB4+siXeaHpYbRVDNg65TxmzsE5p3QVSiYklvCN7rpp5t2mqcu1ExFQ7y+i6nion1m7lqpRDgOHVSacAeKQxeHJ+wHVluEG/F1uVLSoAelKJSw0qms= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=DDmqGdmn; 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=pass 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="DDmqGdmn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762974857; x=1794510857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BM3/WsEhx6V4q9gdSQn84p7QgaZ00RWNFD1Rpo6D9Ic=; b=DDmqGdmnSAn899RWrgtQvrR+B9bjG7NXmKm/9HvT9+at2UMUFNJvvHio 4xDcZIYq8aehtCtbhszcFZvU6eShsasAXq7L+zYN9p7vc3P23bQV6Ee7D NtrT5t3nCJ1/O9YiIJepNJtjs4bRvyMwBJEoNnF8p5nXM1D0DE7mabWVG OGSDZNV3m+pURl7b9xZ0q5mH9OZFbr/clJXp/l6Nzk4hA+XJKYxVsTy1T mVDBNMsPdk6jgNovqC9NxeuHukqlfFGbNcPFc/l3Bso0nCV842rEB4ieO JakxkTIopTE/Yf5z2FI9hzzPxqZGIRVKXOGQkBKsyrE2ES71IfVnQpNhW w==; X-CSE-ConnectionGUID: Cu4chYyCQgG9gGa6aEZoVg== X-CSE-MsgGUID: J/dy3pNNQx24dvkj4zGzSQ== X-IronPort-AV: E=McAfee;i="6800,10657,11611"; a="65086879" X-IronPort-AV: E=Sophos;i="6.19,300,1754982000"; d="scan'208";a="65086879" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2025 11:14:16 -0800 X-CSE-ConnectionGUID: rgYLfN/PSuiBg+Z3VBOFIw== X-CSE-MsgGUID: nOfF5zywQMusWabLKvSoxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,300,1754982000"; d="scan'208";a="219951616" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa002.jf.intel.com with ESMTP; 12 Nov 2025 11:14:16 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id A4DD097; Wed, 12 Nov 2025 20:14:14 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH v1 2/5] Input: gpio_decoder - unify messages with help of dev_err_probe() Date: Wed, 12 Nov 2025 20:13:18 +0100 Message-ID: <20251112191412.2088105-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251112191412.2088105-1-andriy.shevchenko@linux.intel.com> References: <20251112191412.2088105-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" Unify error messages that might appear during probe phase by switching to use dev_err_probe(). Signed-off-by: Andy Shevchenko --- drivers/input/misc/gpio_decoder.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/input/misc/gpio_decoder.c b/drivers/input/misc/gpio_de= coder.c index 459abc749a49..a2ae400790f9 100644 --- a/drivers/input/misc/gpio_decoder.c +++ b/drivers/input/misc/gpio_decoder.c @@ -7,6 +7,7 @@ */ =20 #include +#include #include #include #include @@ -73,15 +74,12 @@ static int gpio_decoder_probe(struct platform_device *p= dev) device_property_read_u32(dev, "linux,axis", &decoder->axis); =20 decoder->input_gpios =3D devm_gpiod_get_array(dev, NULL, GPIOD_IN); - if (IS_ERR(decoder->input_gpios)) { - dev_err(dev, "unable to acquire input gpios\n"); - return PTR_ERR(decoder->input_gpios); - } + if (IS_ERR(decoder->input_gpios)) + return dev_err_probe(dev, PTR_ERR(decoder->input_gpios), + "unable to acquire input gpios\n"); =20 - if (decoder->input_gpios->ndescs < 2) { - dev_err(dev, "not enough gpios found\n"); - return -EINVAL; - } + if (decoder->input_gpios->ndescs < 2) + return dev_err_probe(dev, -EINVAL, "not enough gpios found\n"); =20 if (device_property_read_u32(dev, "decoder-max-value", &max)) max =3D (1U << decoder->input_gpios->ndescs) - 1; @@ -97,16 +95,12 @@ static int gpio_decoder_probe(struct platform_device *p= dev) input_set_abs_params(input, decoder->axis, 0, max, 0, 0); =20 err =3D input_setup_polling(input, gpio_decoder_poll_gpios); - if (err) { - dev_err(dev, "failed to set up polling\n"); - return err; - } + if (err) + return dev_err_probe(dev, err, "failed to set up polling\n"); =20 err =3D input_register_device(input); - if (err) { - dev_err(dev, "failed to register input device\n"); - return err; - } + if (err) + return dev_err_probe(dev, err, "failed to register input device\n"); =20 return 0; } --=20 2.50.1 From nobody Sat Feb 7 18:21:16 2026 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 0CE4E34D908; Wed, 12 Nov 2025 19:14:21 +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=1762974863; cv=none; b=lgvy3Lx+7c/SLu6zkmI91+MNxf9sUFlVK86ysWUrDOi7UMG7/Ij1xh+OsIu5CA3AD3j8NKElqwDmcJXaue89Bag1jCLF2cX867ruCzYg6BcsULF2zm6uEhqQxV84+1Sr/8H8K33GLfydH8kndL+Dv6c9x1E07e4XrPSAd1f05Kk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762974863; c=relaxed/simple; bh=JPnsL1Fqba1yPR8H9hojJp1nnZEdKoqx4paCLzojuPw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B9bGQnETzikEKSKmYkONP37XJv/9ByMFlKfPEPvBSqD/UDFU47OOrlcNZ77YiA3Pz4aZ0vUrz960LfgJvrqz/EpZ/TfG9YOjaN/dAlSSfYgUkYsRxFTSw+UIMTRaUwRJFojoZHtk1m+ZFyjxnvUPlfBpoqVU6TfvIN1udASUVks= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ZxqxILt8; 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=pass 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="ZxqxILt8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762974861; x=1794510861; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JPnsL1Fqba1yPR8H9hojJp1nnZEdKoqx4paCLzojuPw=; b=ZxqxILt8vy0PcOsi5HJwIC7eEJTl4H8lXPDEed4U5ek7s0gPSnD3gqnd erJGhXPkaqiSDkNg9C8CeznQJEnOKkUGwOuYp+PJhfCuMF3krbf9FPNXa 6QPciYT8L7KRwrZudbJyVQQBbIgHGyAxfuS1frpCAK5sLSghpDPwL1BaO c8S+6ouvYgn/d0tOzRUKwtgW6bsUXAdbSyhvr8/+fLmJe/mMBNJi6rHFG h1qQ2j8DKInmU3NoYzfHenK9EbpK2giau5T7QFzqvvyQRUGk80FxOKWX8 I4NMY/iwqLq986oOVU+WYiRBknpmvqW5x2GVMVndJgcGlZ8BPPoPooyYi g==; X-CSE-ConnectionGUID: 1LgZvyrPQaqsyZVlS7yX+Q== X-CSE-MsgGUID: sfd6FRBjQASJOU2kkP0hLQ== X-IronPort-AV: E=McAfee;i="6800,10657,11611"; a="65086887" X-IronPort-AV: E=Sophos;i="6.19,300,1754982000"; d="scan'208";a="65086887" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2025 11:14:16 -0800 X-CSE-ConnectionGUID: i8JkIVxFSm64RomS/mGzig== X-CSE-MsgGUID: /St21FVZRD+BKR7xYN/BHg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,300,1754982000"; d="scan'208";a="219951619" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa002.jf.intel.com with ESMTP; 12 Nov 2025 11:14:16 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id A996398; Wed, 12 Nov 2025 20:14:14 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH v1 3/5] Input: gpio_decoder - replace custom loop by gpiod_get_array_value_cansleep() Date: Wed, 12 Nov 2025 20:13:19 +0100 Message-ID: <20251112191412.2088105-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251112191412.2088105-1-andriy.shevchenko@linux.intel.com> References: <20251112191412.2088105-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" There is a custom loop that repeats parts of gpiod_get_array_value_cansleep= (). Use that in conjunction with bitmap API to make code shorter and easier to follow. With this done, add an upper check for amount of GPIOs given based on the driver's code. Signed-off-by: Andy Shevchenko --- drivers/input/misc/gpio_decoder.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/input/misc/gpio_decoder.c b/drivers/input/misc/gpio_de= coder.c index a2ae400790f9..8c07f7ff66e5 100644 --- a/drivers/input/misc/gpio_decoder.c +++ b/drivers/input/misc/gpio_decoder.c @@ -6,11 +6,13 @@ * encoded numeric value into an input event. */ =20 +#include #include #include #include #include #include +#include #include #include #include @@ -26,23 +28,18 @@ struct gpio_decoder { static int gpio_decoder_get_gpios_state(struct gpio_decoder *decoder) { struct gpio_descs *gpios =3D decoder->input_gpios; - unsigned int ret =3D 0; - int i, val; + DECLARE_BITMAP(values, 32); + unsigned int size; + int err; =20 - for (i =3D 0; i < gpios->ndescs; i++) { - val =3D gpiod_get_value_cansleep(gpios->desc[i]); - if (val < 0) { - dev_err(decoder->dev, - "Error reading gpio %d: %d\n", - desc_to_gpio(gpios->desc[i]), val); - return val; - } - - val =3D !!val; - ret =3D (ret << 1) | val; + size =3D min(gpios->ndescs, 32U); + err =3D gpiod_get_array_value_cansleep(size, gpios->desc, gpios->info, va= lues); + if (err) { + dev_err(decoder->dev, "Error reading GPIO: %d\n", val); + return err; } =20 - return ret; + return bitmap_read(values, 0, size); } =20 static void gpio_decoder_poll_gpios(struct input_dev *input) @@ -81,6 +78,9 @@ static int gpio_decoder_probe(struct platform_device *pde= v) if (decoder->input_gpios->ndescs < 2) return dev_err_probe(dev, -EINVAL, "not enough gpios found\n"); =20 + if (decoder->input_gpios->ndescs > 31) + return dev_err_probe(dev, -EINVAL, "too many gpios found\n"); + if (device_property_read_u32(dev, "decoder-max-value", &max)) max =3D (1U << decoder->input_gpios->ndescs) - 1; =20 --=20 2.50.1 From nobody Sat Feb 7 18:21:16 2026 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 B0EF034888E; Wed, 12 Nov 2025 19:14:19 +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=1762974861; cv=none; b=dStKAsMn+s8NOXmFVNDzr5WVj+h8ChIqZbVky9ZTrk6OSJjNPglYL0LEcyRslKD/59YP7OubPf7p7IC9AQMXXpzyPFpy/JbBoBiXgwZhRahV3Dr+56F5EmDvf9xVjNXpjpTOMd3oBr6Ua+SGgBum6XKuvGpiR/vmawnHpIrlXpQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762974861; c=relaxed/simple; bh=eza3j0+EuTOOHO74CxzObedr0qx+jM54OCacx5vMhDI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vc4XIexPI58FTAfz+56/6GHyOyD23IgQb4wL/9eiC5c2O1f/zmfhoHB7Pu7mQOdFdwDREP1IaDgCD7CCPQ9TffmGla+oVJiV6mwcA1lH1QLeIAHitxftaup4cNegp4yceWP5+4H/QjdS4ojarLX0HXforoi2+bLq2EKEyBFFF/E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LZxf3VD8; 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=pass 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="LZxf3VD8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762974859; x=1794510859; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eza3j0+EuTOOHO74CxzObedr0qx+jM54OCacx5vMhDI=; b=LZxf3VD8Rn5AMKFHntLNsmutNW8tdXn7ybQ49bcuyThAa7kpMv9PLtU3 +Toq6rQilfjarR7495Czh22rwBhnMFhQOs7HetNCgFNwknCmgY0CDzHXr KW5/et9WJrMftw8KlumA9A0vQrB1k7cTVctOogrIFXbx3NGH1yjs7kUs5 P50Ja+ikXeaKi8/pw92Fxaux8RZOLqYwIvTOjd5k53OG/oag7pkFs0nBG LANc88dQ1h2/bul8S3sDhFxuGMvGA8bBsHDq7XpZCCb0r5FCyUJCw7tJW qGLz06XqJi2Os4XBwz678gbVXFCyRQ+Zi2lz6PJaN3ZSgECQrBwsqMDvZ Q==; X-CSE-ConnectionGUID: Ww0TDe2DTPCyg4Ar4KfVEg== X-CSE-MsgGUID: swMP5UaxQrKgEmeTyFk0TA== X-IronPort-AV: E=McAfee;i="6800,10657,11611"; a="65086881" X-IronPort-AV: E=Sophos;i="6.19,300,1754982000"; d="scan'208";a="65086881" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2025 11:14:16 -0800 X-CSE-ConnectionGUID: g+mrirHxSyCc2TaAS7rIkg== X-CSE-MsgGUID: jB86uPVwTI6tf39+G5KHkA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,300,1754982000"; d="scan'208";a="219951617" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa002.jf.intel.com with ESMTP; 12 Nov 2025 11:14:16 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id ADD1399; Wed, 12 Nov 2025 20:14:14 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH v1 4/5] Input: gpio_decoder - make use of the macros from bits.h Date: Wed, 12 Nov 2025 20:13:20 +0100 Message-ID: <20251112191412.2088105-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251112191412.2088105-1-andriy.shevchenko@linux.intel.com> References: <20251112191412.2088105-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" Make use of BIT() where it makes sense. Signed-off-by: Andy Shevchenko --- drivers/input/misc/gpio_decoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/gpio_decoder.c b/drivers/input/misc/gpio_de= coder.c index 8c07f7ff66e5..299f16d3bf4d 100644 --- a/drivers/input/misc/gpio_decoder.c +++ b/drivers/input/misc/gpio_decoder.c @@ -60,7 +60,7 @@ static int gpio_decoder_probe(struct platform_device *pde= v) struct device *dev =3D &pdev->dev; struct gpio_decoder *decoder; struct input_dev *input; - u32 max; + u32 max; int err; =20 decoder =3D devm_kzalloc(dev, sizeof(*decoder), GFP_KERNEL); @@ -82,7 +82,7 @@ static int gpio_decoder_probe(struct platform_device *pde= v) return dev_err_probe(dev, -EINVAL, "too many gpios found\n"); =20 if (device_property_read_u32(dev, "decoder-max-value", &max)) - max =3D (1U << decoder->input_gpios->ndescs) - 1; + max =3D BIT(decoder->input_gpios->ndescs) - 1; =20 input =3D devm_input_allocate_device(dev); if (!input) --=20 2.50.1 From nobody Sat Feb 7 18:21:16 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 1C9BE34C80C; Wed, 12 Nov 2025 19:14:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762974862; cv=none; b=baibeBFGyxl4SDD/ikUmHAE6D8u0XfCzeVOI/aLCrOHh61/NSMRAxvrepnR3aRwfiaWOpfa7lNcvkUNqw/lpUAs+lKbYek/ig0SqE2LMabjmy4e+GUQdLf0C1lZurJKTTki+fd1YBTPkt/plBZ40GgbutdM6Ia/mrX69xcpAM6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762974862; c=relaxed/simple; bh=8JxfYB+Q+An/5n/qTbjztLA2HZ6jSDINtZpjr0jXnSA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pb5Hup5Nnb+eqgp4+RRj8pqufBxsqrJJkxHOfVNvXySoDQwESo/ds2RIZoLtoVyXbVwSBi6Wb51GhdeiLfNi3Wl7Sx3t8e1MVOmLlt6oJupyHEkVLyTdoXRY1LQfgXV9GxSqlcdir9JzNppddiqf4b6p8KQ/zbxgpbvElcA1DAA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IMzWwhc9; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass 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="IMzWwhc9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762974860; x=1794510860; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8JxfYB+Q+An/5n/qTbjztLA2HZ6jSDINtZpjr0jXnSA=; b=IMzWwhc9H33aDpgh+yaKtRIcEdwFng2a6mqh6C+FVPtMhXWo8K/9WLq1 x/7lquZ+Es1oHhrhxUUcqGN+PIiefBj8nFQv/DfBcjGWvU0EVNrsl+yOy WCtgY87POhG4zQDj85tF74e/LcEPHqhm9kj6SU6vkl1fMe/pMShhKRC5Y 1JZ0PWRcldBYwq3MuRz6k6mw9A/G4ygDqkxGI/qzTASAGSa5nRrBTSwkP OUwCkxmHW66E30AnDwuRJvh5G0LZx0gzmbDwlSvJyEvE/uM0Bpwsh7Oci vvr4vJQhPUBMro91F/kU1B4Yom3ZGEHDqs6H6K1wgbCZhxmErG+DBUt1P w==; X-CSE-ConnectionGUID: Sss9fLKkQ96Hkznia+GYGQ== X-CSE-MsgGUID: 1nAD30znRxig2kduGnzGZA== X-IronPort-AV: E=McAfee;i="6800,10657,11611"; a="82678728" X-IronPort-AV: E=Sophos;i="6.19,300,1754982000"; d="scan'208";a="82678728" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2025 11:14:19 -0800 X-CSE-ConnectionGUID: iVQPWONJSm+jFXwAijBBJQ== X-CSE-MsgGUID: 4G6/DpzMQxiIqv9zzyMHUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,300,1754982000"; d="scan'208";a="189576359" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa008.fm.intel.com with ESMTP; 12 Nov 2025 11:14:17 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id B20249A; Wed, 12 Nov 2025 20:14:14 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH v1 5/5] Input: gpio_decoder - don't use "proxy" headers Date: Wed, 12 Nov 2025 20:13:21 +0100 Message-ID: <20251112191412.2088105-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251112191412.2088105-1-andriy.shevchenko@linux.intel.com> References: <20251112191412.2088105-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" Update header inclusions to follow IWYU (Include What You Use) principle. Signed-off-by: Andy Shevchenko --- drivers/input/misc/gpio_decoder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/gpio_decoder.c b/drivers/input/misc/gpio_de= coder.c index 299f16d3bf4d..5fe56ae58183 100644 --- a/drivers/input/misc/gpio_decoder.c +++ b/drivers/input/misc/gpio_decoder.c @@ -7,16 +7,17 @@ */ =20 #include -#include +#include +#include #include #include #include -#include #include #include #include #include #include +#include =20 struct gpio_decoder { struct gpio_descs *input_gpios; --=20 2.50.1