[PATCH 01/11] button: qcom-pmic: introduce exported setup method
Simon Glass
sjg at chromium.org
Fri Jun 26 12:37:33 CEST 2026
Hi Sam,
On 2026-06-06T08:47:32, Sam Day via B4 Relay
<devnull+me.samcday.com at kernel.org> wrote:
> button: qcom-pmic: introduce exported setup method
>
> The qcom_pwrkey driver is currently binding to both the individual
> pwrkey/resin nodes, as well as the parent pon node.
>
> In the next commit, a new glue driver will be introduced for pm8916_pon,
> which will continue binding these buttons, as well as additional
> drivers.
>
> button_qcom_pmic_bind was renamed to button_qcom_pmic_setup and exported
> in a shared header, which the new pm8916_pon driver will call.
>
> Signed-off-by: Sam Day <me at samcday.com>
> Reviewed-by: Casey Connolly <casey.connolly at linaro.org>
>
> drivers/button/button-qcom-pmic.c | 6 +++---
> include/button/qcom-pmic.h | 17 +++++++++++++++++
> 2 files changed, 20 insertions(+), 3 deletions(-)
> diff --git a/drivers/button/button-qcom-pmic.c b/drivers/button/button-qcom-pmic.c
> @@ -13,9 +13,9 @@
> #include <power/pmic.h>
> -#include <spmi/spmi.h>
> #include <linux/bitops.h>
> #include <time.h>
> +#include 'button/qcom-pmic.h'
Please use angle brackets - this header lives under include/ and is on
the standard search path, so #include <button/qcom-pmic.h>. The same
applies to the include in drivers/misc/pm8916_pon.c (and pm8916_pon.h
itself in a later patch). Quoted includes are reserved for headers
found relative to the .c file. Also check the order (button/ comes
before power/)
> diff --git a/include/button/qcom-pmic.h b/include/button/qcom-pmic.h
> @@ -0,0 +1,17 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +
> +#include <dm/device.h>
> +#include <linux/errno.h>
Missing the usual #ifndef __BUTTON_QCOM_PMIC_H / #define / #endif
guard. The pm8916_pon.h added later in the series has one - please
match that style.
> diff --git a/include/button/qcom-pmic.h b/include/button/qcom-pmic.h
> @@ -0,0 +1,17 @@
> +#else
> +static int button_qcom_pmic_setup(struct udevice *parent)
> +{
> + return -ENOSYS;
> +}
> +#endif
The stub should be static inline - otherwise any translation unit that
includes this header without calling the function gets an
unused-function warning, with multiple-definition risk if it does get
used from more than one .c file. Compare with the pm8916_pon.h stub in
patch 4 which uses static inline correctly.
With those fixed:
Reviewed-by: Simon Glass <sjg at chromium.org>
Regards,
Simon
More information about the U-Boot
mailing list