From nobody Sat Feb 7 22:55:03 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 040CA34572F; Thu, 13 Nov 2025 15:46:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763048782; cv=none; b=rnjYSULw44SNgVIH65SgQ/bGa53KsD9QxSrQ4mq9Ij8BRcPeuZT5ac3vjQUf9a/QGO1Y81QG1ZiCWS1Ro5FJJTDnzrkojJ3VWmMM0wuBgaUtoEhXkQjETnn40Lj5q4gAvzPxtND1ev9KUyoYYL6ajRnPrjlwhljOZf5QWFC+q+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763048782; c=relaxed/simple; bh=100NIUpe/MmbcoRj+BLsbRqmsAMwdJQoi7KDFZ6HdWg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kiGr97fy/Ulkjows1Cdc5smPGoqOBXTMocdqaPT9SHW18KNt2xKJD141bJYKcAQnXIZPthGpK/esa/PAGOtRjAgGNVx0fXO9dlcXLtpnW7nWnEJTtrbga67MrPp2t2FpA/6n25V5amNs0RN119HPOs/tOZCO1SqQj/mpe94roQU= 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=Raz1ToVJ; arc=none smtp.client-ip=198.175.65.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="Raz1ToVJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763048780; x=1794584780; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=100NIUpe/MmbcoRj+BLsbRqmsAMwdJQoi7KDFZ6HdWg=; b=Raz1ToVJZm247NyHghTl93FWOmQ2zUu9f3UDhYZrgGdctrz9zGNLBXx6 CY8h/cp1XBAYJbslUIokCXWb2Sr4zJRREaEupTLV04+hcYahXsfq4OJnf cltt+ei1JN+vtkGobZFJf13iCWxn+cmuCsgeLeLpa0ry5/aw7kiOf2wPG s2mFhuyR5vac87p/I7laO6iVDk95i93yTO8Jgc9sa7bynbU1gzcFf7248 OeXJVFnKXCAMC2AWzpV4D3LPLgk8iBiwm+jH3IWLaBK2Z8XOv1JjF+CqX R156sq18d5FOC+P0anvsp5joKUJWiZASwEMihl+LxtmOgZ3wii+yq6jhC A==; X-CSE-ConnectionGUID: r6c9h4m2RtyHyTeVyKB/JA== X-CSE-MsgGUID: Pi9ZOFM3Q4eWZex9+tYN7Q== X-IronPort-AV: E=McAfee;i="6800,10657,11612"; a="68983126" X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="68983126" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2025 07:46:19 -0800 X-CSE-ConnectionGUID: IX7lCf36RHGfzWP+QyzHjw== X-CSE-MsgGUID: WR8dPHPsTXerbFDmOxwFyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="188819177" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa010.jf.intel.com with ESMTP; 13 Nov 2025 07:46:19 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 8B39197; Thu, 13 Nov 2025 16:46:17 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH v2 1/5] Input: gpio_decoder - make use of device properties Date: Thu, 13 Nov 2025 16:44:42 +0100 Message-ID: <20251113154616.3107676-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251113154616.3107676-1-andriy.shevchenko@linux.intel.com> References: <20251113154616.3107676-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 22:55:03 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 49B6E346E4A; Thu, 13 Nov 2025 15:46:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763048785; cv=none; b=c7PseGaQKZ4WHLzXZnbD9jVL6JjSlRk1XE5BmpD34fXhzbkiJf/jyKeieaarVHuzco4ATRrAP6IJjUxurcGAgVam6XX4H9pDtGHzpxocorIkOf9jTHIYT+yImBR/RfuTD25ofkLKSV7Pvcu3KHx2u4xH1Ee+vQa4CXifeOa9lOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763048785; c=relaxed/simple; bh=BM3/WsEhx6V4q9gdSQn84p7QgaZ00RWNFD1Rpo6D9Ic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m0ySgBGVVU0TD6D8Q6AMbddSUGLFGRQ0xlJTJAPUT0Fl2B1Tl+QfmoBB36148sRR8o9ChCoTUzuGRwMEiQCjKIgXgpdgIGhDxE1WX190A4B8Ah3aT8xG0bP3vTojsHdkUrWPCBswwVCJFPOwXCppVQEV9RhQ15xGEStr5fFUh44= 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=Q4Oz6Xvw; arc=none smtp.client-ip=198.175.65.11 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="Q4Oz6Xvw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763048783; x=1794584783; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BM3/WsEhx6V4q9gdSQn84p7QgaZ00RWNFD1Rpo6D9Ic=; b=Q4Oz6Xvwbo9dxZ3MLk55NVQHtEJ5aXJseVeJMvRLHiAhKidOPQgqKAO0 00Sc0yHW+Q2jpWAYKi/dfOVftqbfJtKqx/2Yj6vj4/mUD0YGq7vW8TwdN bWn2cqi6FNdgF1LfVVfwS4xoBfR3NTqiw8Zjz+shhhtOJW0mO78B3K+QG xwF/y/mMWW8ESShoGG+d2j9esRqu9kyO72Czw4h+4wT6Fxd5MP8k6BEUz eMtQ2gr+YjqxJmnWtCJbLuCFFW98dcIu10/lz2VQUu7Ywz7aTjqfITK+2 Smh96YRNR+SxGmDIIMOpKUhf2WK51LQ1laTv7hcrXOxvdZ195qDtGEpTh w==; X-CSE-ConnectionGUID: wwPcyk09Q4+g8wuFxMGCIA== X-CSE-MsgGUID: MulJG/LOQICSSx2fMNFaAQ== X-IronPort-AV: E=McAfee;i="6800,10657,11612"; a="75448550" X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="75448550" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2025 07:46:20 -0800 X-CSE-ConnectionGUID: ux3w9i91R7OyyWz2cq7VCg== X-CSE-MsgGUID: cQEUSjwlRe+dHy+kAE9Etg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="212933924" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa002.fm.intel.com with ESMTP; 13 Nov 2025 07:46:18 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 8F37598; Thu, 13 Nov 2025 16:46:17 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH v2 2/5] Input: gpio_decoder - unify messages with help of dev_err_probe() Date: Thu, 13 Nov 2025 16:44:43 +0100 Message-ID: <20251113154616.3107676-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251113154616.3107676-1-andriy.shevchenko@linux.intel.com> References: <20251113154616.3107676-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 22:55:03 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 952692F28FA; Thu, 13 Nov 2025 15:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763048783; cv=none; b=nIl/R3Uenbzdr3eWL2ibGwuQs16JgGcBYj8Zt07MDiG/ydVepPAoQz4Eix0hQEswHCE1yLqecuxIRA65atfNDboRiTObp2FHSdH88h2vAnIuZIM+ZiAQjcuBZfZ4GW7EiItyNZcAjNIzwboaRHVXUGHac8+YWmEVd+AnCGxOTIs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763048783; c=relaxed/simple; bh=j8WPIWl6qkDYlVSZbuoLCIhGuEJ83qGYo523B0+8Xus=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ON5P/5aK3rrlmy5o3FoHwkm0CuLAejGfZG75NhaZMZ6g5FFbyqSJVcDJJJpBvYLJjvGOJYsemDDFe4TFUC3CF0017VYg4d24zUS0k0IIS2MbqDwkl6Dc6KM9uBxWzgN47d5C2ne1sq/YjBc177boHrSeHb97kkrdJFvMEGWhN2g= 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=XpbvZszs; arc=none smtp.client-ip=198.175.65.11 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="XpbvZszs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763048782; x=1794584782; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j8WPIWl6qkDYlVSZbuoLCIhGuEJ83qGYo523B0+8Xus=; b=XpbvZszsSm/Ty0kP89lNGILZ/jKL7gb2vQRNx9qPdnWagg9pKU6oCe4C oQcvMu7mjkMK1Yh7mWGJYAkeqIenBHDAdOBir4kwCkfszNS2qImt+U3sd XbBWgM8uin+o/RysgBFnl46toNKZOyQLE0G/59ycySDac8bXaZ9yWNaSD MYOtPX1H/kKw2ZP9z/Gyo/wPTErm9z4z6jDCHj02F66XS8p0i00drjdiE +yvoXUyyvLO4kanfH42jZ3GrH4d73uFxRosq4NnZHX0vovOKclRXA6Pvx yQ5Ng2cZI/aF0ZZ79P1I9nOj6I03jIkftpZWu0x//QQUvKR/dikfAHDxw Q==; X-CSE-ConnectionGUID: GaQkzg1UShSG537vcQ1h2g== X-CSE-MsgGUID: gJpEHaVSRKWKPzhxKvQo4w== X-IronPort-AV: E=McAfee;i="6800,10657,11612"; a="75448545" X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="75448545" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2025 07:46:20 -0800 X-CSE-ConnectionGUID: j06jTqgPRO+DBiFm+q5DYg== X-CSE-MsgGUID: aQM3pfs5Q+KfBOPMxuozPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="212933922" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa002.fm.intel.com with ESMTP; 13 Nov 2025 07:46:18 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 9382D99; Thu, 13 Nov 2025 16:46:17 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH v2 3/5] Input: gpio_decoder - replace custom loop by gpiod_get_array_value_cansleep() Date: Thu, 13 Nov 2025 16:44:44 +0100 Message-ID: <20251113154616.3107676-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251113154616.3107676-1-andriy.shevchenko@linux.intel.com> References: <20251113154616.3107676-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..7f319b932550 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", err); + 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 22:55:03 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 BEE01346795; Thu, 13 Nov 2025 15:46:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763048784; cv=none; b=no0YHm18QaKpK7W72ueoo7w9vU+vn6XSTFuD/D3OZQyWyzQ7NU2XtHtIHnVCnbWvId8iDPZlMw9HmcSAbA7dn+hULLjsyAS5RPAqtEOeYerKC1O4xZ6EY1YpGbk5LXoXedGjXO97b1UTh3/7z9q29LvDGlXEkbkj/z+78P8ViBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763048784; c=relaxed/simple; bh=uO8NvJOunCO6wpxP9XWnyz5rYhnDRXXJdrD0fq0KUGY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jcyZVZtC4Yd10RhI8spGKNClbok2C0efswXeUbHed0arVcHUhrTS8DcgqZ3P1JJx/BAGBSwqNRWj3Wr2dWehcEGb9JN+FkVlDuSyzWQSdTH9tBGbj2NkGTxPL6z2auzN8h+1MCYKWZSr8Kmf51iNwSiYFaMuc7hcreWgjwV3JXI= 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=bceVHHMR; arc=none smtp.client-ip=198.175.65.11 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="bceVHHMR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763048783; x=1794584783; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uO8NvJOunCO6wpxP9XWnyz5rYhnDRXXJdrD0fq0KUGY=; b=bceVHHMRMbpoHuXTCn6GoobMpF7/kXTc7iB7xwf4J9EGRJ6uAbLODFYZ ti+2eH0UYm51lW17ZyvHAYfvdy3zpl+owIknxs0WJbNyBQqIGAAUOS8SB YhxyARiXqEGDegBfAhUh3XjX3zkVgvNeDYCRW+mGw0FxmvPH9vYbeNNkK 6tJqtteksNA+Snz1IF6KwFlEmyZ4FMe5HQfqOjehLWWZe0taEX1e8UcxY eIsD7j8Z5NZ57Lcg5DDW8gspqq9tNEtmbsTA14kcgodc8OBPjDoEer6QR IB3/g4yotP2e648WXBlP2Sgy/3vuWYNFdQKuZ5+N0KYaB6Qpiw3spqdsd A==; X-CSE-ConnectionGUID: MICBWDBmTvKmvAhiGf3q1Q== X-CSE-MsgGUID: x3xLSqLYRka9zJkKesMXcQ== X-IronPort-AV: E=McAfee;i="6800,10657,11612"; a="75448548" X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="75448548" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2025 07:46:20 -0800 X-CSE-ConnectionGUID: 1TGFAM0uRziPiU5k4xAWsQ== X-CSE-MsgGUID: tqiCKJazS9+q0w7NfBkDYg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="212933923" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa002.fm.intel.com with ESMTP; 13 Nov 2025 07:46:18 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 97CFE9A; Thu, 13 Nov 2025 16:46:17 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH v2 4/5] Input: gpio_decoder - make use of the macros from bits.h Date: Thu, 13 Nov 2025 16:44:45 +0100 Message-ID: <20251113154616.3107676-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251113154616.3107676-1-andriy.shevchenko@linux.intel.com> References: <20251113154616.3107676-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 7f319b932550..057717de9849 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 22:55:03 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 75B8E346FA5; Thu, 13 Nov 2025 15:46:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763048785; cv=none; b=XU66a5PSr+wo1NiOoiKprui7Q4IQE5i5v7AExAydRdP31Q5WQs6n4RH3WZEU2N6dnndDWBe3gaog5BU3M+XeaRRlrNYlgwoSBhtED4W8Zwe25P9R75PnUxv5048tuG/aweNXQjVQF/JuvtyVI0AWLSY6WUkGesJ2zNkpzI2hwRQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763048785; c=relaxed/simple; bh=NH/ceQ3mjaQT5vDkEJD/gpQXnn3J2iODCOYBIFZ/XiU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FAuFUoVMBIIzfZYmUClavLZyczrVnzrQZJPt9QxVqZg1iinO6Wmn12G+yAOesJFAl3IZI4pbLBEr3Ik9Q/qSeTG5vLsibNyezJ0/OHtC3fwiJc9WpySOeIJB89riMeJ8CQYNloJ2qjRHZ1p7/naUHUrtEsAQGGbxILBdv8XT+hM= 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=jRjZMGgh; arc=none smtp.client-ip=198.175.65.11 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="jRjZMGgh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763048783; x=1794584783; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NH/ceQ3mjaQT5vDkEJD/gpQXnn3J2iODCOYBIFZ/XiU=; b=jRjZMGgh1JSkChCThIRtryWoJY4e9InMKdZoZS+OW8CcjGWnc3dd8cdf 398xztILEPKjleVuNkAiuIWYWSPbdoi6T3EQdv2NWJNku38nNMBVZYhZx DTEQdv1zo1a6nAlceoplWv2bM3Wbu/FkpkhTxoYcXzoz4jd3jo16LEUbL 04Tu37GPQO9NmhZfb3gFNbJnyZZ+OnL2Xz9CzA+cQWFZWquPQi4S6hvTn NbsR2VPNGkBT0eVEj/mXtFJKyl+krbx30SnoxlcDTUxhp1DD5Susbw5TW h7lQIEh4OOafehn9oawbjK5h0F5hYjXj+YKTA2jOhpmdmkW0G7EZJ0GCg Q==; X-CSE-ConnectionGUID: SaHXMf/wQi2QGobeTCKBeA== X-CSE-MsgGUID: FOWMf11rR8GoZVwztInXdQ== X-IronPort-AV: E=McAfee;i="6800,10657,11612"; a="75448553" X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="75448553" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2025 07:46:21 -0800 X-CSE-ConnectionGUID: +Rmr1sA0Qvif7Q+t9tR6zg== X-CSE-MsgGUID: sF/6SQ2jRM21vyIuMdyKmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,302,1754982000"; d="scan'208";a="212933929" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa002.fm.intel.com with ESMTP; 13 Nov 2025 07:46:20 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 9C2E89B; Thu, 13 Nov 2025 16:46:17 +0100 (CET) From: Andy Shevchenko To: Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH v2 5/5] Input: gpio_decoder - don't use "proxy" headers Date: Thu, 13 Nov 2025 16:44:46 +0100 Message-ID: <20251113154616.3107676-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251113154616.3107676-1-andriy.shevchenko@linux.intel.com> References: <20251113154616.3107676-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 057717de9849..f0759dd39b35 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