* Re: [PATCH 0/4] leds: trigger: Improve handling of led_trigger_event() and simplify mute audio trigger
From: Lee Jones @ 2024-03-05 10:40 UTC (permalink / raw)
To: Takashi Iwai
Cc: Heiner Kallweit, Pavel Machek, Jaroslav Kysela, Takashi Iwai,
Dmitry Torokhov, Thomas Bogendoerfer, linux-leds@vger.kernel.org,
linux-sound, open list:HID CORE LAYER, linux-mips
In-Reply-To: <875xy1ynya.wl-tiwai@suse.de>
On Tue, 05 Mar 2024, Takashi Iwai wrote:
> On Tue, 05 Mar 2024 10:55:39 +0100,
> Lee Jones wrote:
> >
> > On Sat, 02 Mar 2024, Heiner Kallweit wrote:
> >
> > > On 29.02.2024 18:26, Lee Jones wrote:
> > > > On Tue, 13 Feb 2024, Heiner Kallweit wrote:
> > > >
> > > >> If a simple trigger is assigned to a LED, then the LED may be off until
> > > >> the next led_trigger_event() call. This may be an issue for simple
> > > >> triggers with rare led_trigger_event() calls, e.g. power supply
> > > >> charging indicators (drivers/power/supply/power_supply_leds.c).
> > > >> Therefore persist the brightness value of the last led_trigger_event()
> > > >> call and use this value if the trigger is assigned to a LED.
> > > >> This change allows to use simple triggers in more cases.
> > > >> As a first use case simplify handling of the mute audio trigger.
> > > >>
> > > >> This series touches few subsystems. I'd propose to handle it via
> > > >> the LED subsystem.
> > > >>
> > > >> Heiner Kallweit (4):
> > > >> leds: trigger: Store brightness set by led_trigger_event()
> > > >> ALSA: control-led: Integrate mute led trigger
> > > >> Input: leds: Prepare for removal of config option LEDS_AUDIO_TRIGGER
> > > >> leds: trigger: audio: Remove this trigger
> > > >>
> > > >> arch/mips/configs/ci20_defconfig | 1 -
> > > >
> > > >> drivers/input/input-leds.c | 8 +---
> > > >
> > > > This does not apply.
> > > >
> > > > Please rebase onto v6.8-rc1.
> > > >
> > > Since v6.8-rc1 the following has been added, which is touched by
> > > my series:
> > > 698b43780ba2 ("Input: leds - set default-trigger for mute")
> > >
> > > Rebasing onto v6.8-rc1 would mean:
> > > - remove the change to input-leds from the series
> > > - resubmit this change via input subsystem
> > >
> > > This would affect bisectability, because for the time being
> > > input-leds would reference a config symbol that doesn't exist
> > > any longer.
> > >
> > > We'd be fine only if the change to input-leds is applied first.
> > > I think that's the best way to go, if you can't accept a series
> > > based on linux-next.
> >
> > Then it's going to have to wait until v6.10.
>
> Or merging via input tree?
> The changes are relatively small and easy, after all.
That's likely to culminate in similar merge-conflicts when further
changes are made to:
drivers/leds/led-triggers.c
drivers/leds/trigger/Kconfig
drivers/leds/trigger/Makefile
drivers/leds/trigger/ledtrig-audio.c
include/linux/leds.h
What happens if I take all but the Input change? If this doesn't cause
build-failures and the Input change will definitely land in v6.9, it
could work.
--
Lee Jones [李琼斯]
^ permalink raw reply
* Re: [PATCH v3 00/10] backlight: Replace struct fb_info in interfaces
From: Lee Jones @ 2024-03-05 10:44 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: andy, daniel.thompson, jingoohan1, deller, robin, javierm,
dri-devel, linux-fbdev, linux-input, linux-pwm
In-Reply-To: <20240304163220.19144-1-tzimmermann@suse.de>
On Mon, 04 Mar 2024, Thomas Zimmermann wrote:
> Backlight drivers implement struct backlight_ops.check_fb, which
> uses struct fb_info in its interface. Replace the callback with one
> that does not use fb_info.
>
> In DRM, we have several drivers that implement backlight support. By
> including <linux/backlight.h> these drivers depend on <linux/fb.h>.
> At the same time, fbdev is deprecated for new drivers and likely to
> be replaced on many systems.
>
> This patchset is part of a larger effort to implement the backlight
> code without depending on fbdev.
>
> Patch 1 makes the backlight core match backlight and framebuffer
> devices via struct fb_info.bl_dev. Patches 2 to 9 then go through
> drivers and remove unnecessary implementations of check_fb. Finally,
> patch 10 replaces the check_fb hook with controls_device, which
> uses the framebuffer's Linux device instead of the framebuffer.
>
> v3:
> * hide CONFIG_FB_BACKLIGHT behind fb_bl_device() (Lee)
> * if-else cleanups (Andy)
> * fix commit message of patch 2 (Andy)
> v2:
> * fix hid-picolcd for CONFIG_FB_BACKLIGHT=n
> * fixes to commit messages
>
> Thomas Zimmermann (10):
> backlight: Match backlight device against struct fb_info.bl_dev
> auxdisplay/ht16k33: Remove struct backlight_ops.check_fb
> hid/hid-picolcd: Fix initialization order
> hid/hid-picolcd: Remove struct backlight_ops.check_fb
> backlight/aat2870-backlight: Remove struct backlight.check_fb
> backlight/pwm-backlight: Remove struct backlight_ops.check_fb
> fbdev/sh_mobile_lcdc_fb: Remove struct backlight_ops.check_fb
> fbdev/ssd1307fb: Init backlight before registering framebuffer
> fbdev/ssd1307fb: Remove struct backlight_ops.check_fb
> backlight: Add controls_device callback to struct backlight_ops
>
> drivers/auxdisplay/ht16k33.c | 8 ------
> drivers/hid/hid-picolcd_backlight.c | 7 ------
> drivers/hid/hid-picolcd_core.c | 14 +++++------
> drivers/hid/hid-picolcd_fb.c | 6 +++++
> drivers/video/backlight/aat2870_bl.c | 7 ------
> drivers/video/backlight/backlight.c | 8 ++++--
> drivers/video/backlight/bd6107.c | 12 ++++-----
> drivers/video/backlight/gpio_backlight.c | 12 ++++-----
> drivers/video/backlight/lv5207lp.c | 12 ++++-----
> drivers/video/backlight/pwm_bl.c | 12 ---------
> drivers/video/fbdev/core/fb_backlight.c | 5 ++++
> drivers/video/fbdev/sh_mobile_lcdcfb.c | 7 ------
> drivers/video/fbdev/ssd1307fb.c | 31 +++++++++---------------
> include/linux/backlight.h | 16 ++++++------
> include/linux/fb.h | 9 +++++++
> include/linux/pwm_backlight.h | 1 -
> 16 files changed, 70 insertions(+), 97 deletions(-)
All applied. Submitted for build testing.
Will follow-up with a PR once that's passed.
--
Lee Jones [李琼斯]
^ permalink raw reply
* Re: [RFC PATCH v3 2/5] mfd: add driver for Marvell 88PM886 PMIC
From: Lee Jones @ 2024-03-05 11:44 UTC (permalink / raw)
To: Karel Balej
Cc: Karel Balej, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Dmitry Torokhov, Liam Girdwood, Mark Brown, devicetree,
linux-kernel, linux-input, Duje Mihanović,
~postmarketos/upstreaming, phone-devel
In-Reply-To: <20240303101506.4187-3-karelb@gimli.ms.mff.cuni.cz>
On Sun, 03 Mar 2024, Karel Balej wrote:
> From: Karel Balej <balejk@matfyz.cz>
>
> Marvell 88PM886 is a PMIC which provides various functions such as
> onkey, battery, charger and regulators. It is found for instance in the
> samsung,coreprimevelte smartphone with which this was tested.
>
> Only implement basic support to allow for the use of regulators and
> onkey omitting the currently unused register definitions and I2C
> subclients which should thus be added with the subdevice drivers which
> need them.
>
> Signed-off-by: Karel Balej <balejk@matfyz.cz>
> ---
>
> Notes:
> RFC v3:
> - Drop onkey cell .of_compatible.
> - Rename LDO page offset and regmap to REGULATORS.
> RFC v2:
> - Remove some abstraction.
> - Sort includes alphabetically and add linux/of.h.
> - Depend on OF, remove of_match_ptr and add MODULE_DEVICE_TABLE.
> - Use more temporaries and break long lines.
> - Do not initialize ret in probe.
> - Use the wakeup-source DT property.
> - Rename ret to err.
> - Address Lee's comments:
> - Drop patched in presets for base regmap and related defines.
> - Use full sentences in comments.
> - Remove IRQ comment.
> - Define regmap_config member values.
> - Rename data to sys_off_data.
> - Add _PMIC suffix to Kconfig.
> - Use dev_err_probe.
> - Do not store irq_data.
> - s/WHOAMI/CHIP_ID
I still see 'whoami'.
> - Drop LINUX part of include guard name.
> - Merge in the regulator series modifications in order to have more
> devices and modify the commit message accordingly. Changes with
> respect to the original regulator series patches:
> - ret -> err
> - Add temporary for dev in pm88x_initialize_subregmaps.
> - Drop of_compatible for the regulators.
> - Do not duplicate LDO regmap for bucks.
> - Rewrite commit message.
>
> drivers/mfd/88pm886.c | 210 ++++++++++++++++++++++++++++++++++++
> drivers/mfd/Kconfig | 12 +++
> drivers/mfd/Makefile | 1 +
> include/linux/mfd/88pm886.h | 46 ++++++++
> 4 files changed, 269 insertions(+)
> create mode 100644 drivers/mfd/88pm886.c
> create mode 100644 include/linux/mfd/88pm886.h
>
> diff --git a/drivers/mfd/88pm886.c b/drivers/mfd/88pm886.c
> new file mode 100644
> index 000000000000..c17220e1b7e2
> --- /dev/null
> +++ b/drivers/mfd/88pm886.c
> @@ -0,0 +1,210 @@
> +// SPDX-License-Identifier: GPL-2.0-only
Header? Description? Author? Copyright?
> +#include <linux/i2c.h>
> +#include <linux/mfd/core.h>
> +#include <linux/module.h>
> +#include <linux/notifier.h>
> +#include <linux/of.h>
> +#include <linux/reboot.h>
> +#include <linux/regmap.h>
> +
> +#include <linux/mfd/88pm886.h>
> +
> +#define PM886_REG_INT_STATUS1 0x05
> +
> +#define PM886_REG_INT_ENA_1 0x0a
> +#define PM886_INT_ENA1_ONKEY BIT(0)
> +
> +#define PM886_REGMAP_CONF_REG_BITS 8
> +#define PM886_REGMAP_CONF_VAL_BITS 8
These 2 are not commonly defined, just the one below please.
> +#define PM886_REGMAP_CONF_MAX_REG 0xfe
> +enum pm886_irq_number {
> + PM886_IRQ_ONKEY,
> +
> + PM886_MAX_IRQ
> +};
Seems superfluous for 1 IRQ and an unused MAX.
Looks like I've mentioned this before.
The IRQ number probably shouldn't be arbitrary either.
> +static struct regmap_irq pm886_regmap_irqs[] = {
> + REGMAP_IRQ_REG(PM886_IRQ_ONKEY, 0, PM886_INT_ENA1_ONKEY),
> +};
> +
> +static struct regmap_irq_chip pm886_regmap_irq_chip = {
> + .name = "88pm886",
> + .irqs = pm886_regmap_irqs,
> + .num_irqs = ARRAY_SIZE(pm886_regmap_irqs),
> + .num_regs = 4,
> + .status_base = PM886_REG_INT_STATUS1,
> + .ack_base = PM886_REG_INT_STATUS1,
> + .unmask_base = PM886_REG_INT_ENA_1,
> +};
> +
> +static struct resource pm886_onkey_resources[] = {
> + DEFINE_RES_IRQ_NAMED(PM886_IRQ_ONKEY, "88pm886-onkey"),
> +};
> +
> +static struct mfd_cell pm886_devs[] = {
> + {
> + .name = "88pm886-onkey",
> + .num_resources = ARRAY_SIZE(pm886_onkey_resources),
> + .resources = pm886_onkey_resources,
> + },
> + {
> + .name = "88pm886-regulator",
> + .id = PM886_REGULATOR_ID_LDO2,
Why doesn't PLATFORM_DEVID_AUTO work for this device?
> + },
> + {
> + .name = "88pm886-regulator",
> + .id = PM886_REGULATOR_ID_LDO15,
> + },
> + {
> + .name = "88pm886-regulator",
> + .id = PM886_REGULATOR_ID_BUCK2,
> + },
> +};
> +
> +static const struct regmap_config pm886_i2c_regmap = {
> + .reg_bits = PM886_REGMAP_CONF_REG_BITS,
> + .val_bits = PM886_REGMAP_CONF_VAL_BITS,
> + .max_register = PM886_REGMAP_CONF_MAX_REG,
> +};
> +
/> +static int pm886_power_off_handler(struct sys_off_data *sys_off_data)
> +{
> + struct pm886_chip *chip = sys_off_data->cb_data;
> + struct regmap *regmap = chip->regmaps[PM886_REGMAP_BASE];
> + struct device *dev = &chip->client->dev;
> + int err;
> +
> + err = regmap_update_bits(regmap, PM886_REG_MISC_CONFIG1, PM886_SW_PDOWN,
> + PM886_SW_PDOWN);
> + if (err) {
> + dev_err(dev, "Failed to power off the device: %d\n", err);
> + return NOTIFY_BAD;
> + }
> + return NOTIFY_DONE;
> +}
> +
> +static int pm886_initialize_subregmaps(struct pm886_chip *chip)
> +{
> + struct device *dev = &chip->client->dev;
> + struct i2c_client *page;
> + struct regmap *regmap;
> + int err;
> +
> + /* regulators page */
> + page = devm_i2c_new_dummy_device(dev, chip->client->adapter,
> + chip->client->addr + PM886_PAGE_OFFSET_REGULATORS);
> + if (IS_ERR(page)) {
> + err = PTR_ERR(page);
> + dev_err(dev, "Failed to initialize regulators client: %d\n", err);
> + return err;
> + }
> + regmap = devm_regmap_init_i2c(page, &pm886_i2c_regmap);
> + if (IS_ERR(regmap)) {
> + err = PTR_ERR(regmap);
> + dev_err(dev, "Failed to initialize regulators regmap: %d\n", err);
> + return err;
> + }
> + chip->regmaps[PM886_REGMAP_REGULATORS] = regmap;
Except for the regulator driver, where else is the regulators regmap used?
> +
> + return 0;
> +}
> +
> +static int pm886_setup_irq(struct pm886_chip *chip,
> + struct regmap_irq_chip_data **irq_data)
> +{
> + struct regmap *regmap = chip->regmaps[PM886_REGMAP_BASE];
> + struct device *dev = &chip->client->dev;
> + int err;
> +
> + /* Set interrupt clearing mode to clear on write. */
> + err = regmap_update_bits(regmap, PM886_REG_MISC_CONFIG2,
> + PM886_INT_INV | PM886_INT_CLEAR | PM886_INT_MASK_MODE,
> + PM886_INT_WC);
> + if (err) {
> + dev_err(dev, "Failed to set interrupt clearing mode: %d\n", err);
> + return err;
> + }
> +
> + err = devm_regmap_add_irq_chip(dev, regmap, chip->client->irq,
> + IRQF_ONESHOT, -1, &pm886_regmap_irq_chip,
> + irq_data);
> + if (err) {
> + dev_err(dev, "Failed to request IRQ: %d\n", err);
> + return err;
> + }
> +
> + return 0;
> +}
> +
> +static int pm886_probe(struct i2c_client *client)
> +{
> + struct regmap_irq_chip_data *irq_data;
> + struct device *dev = &client->dev;
> + struct pm886_chip *chip;
> + struct regmap *regmap;
> + unsigned int chip_id;
> + int err;
> +
> + chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
> + if (!chip)
> + return -ENOMEM;
> +
> + chip->client = client;
> + chip->whoami = (uintptr_t)device_get_match_data(dev);
> + i2c_set_clientdata(client, chip);
> +
> + regmap = devm_regmap_init_i2c(client, &pm886_i2c_regmap);
> + if (IS_ERR(regmap)) {
> + err = PTR_ERR(regmap);
> + return dev_err_probe(dev, err, "Failed to initialize regmap\n");
> + }
> + chip->regmaps[PM886_REGMAP_BASE] = regmap;
> +
> + err = regmap_read(regmap, PM886_REG_ID, &chip_id);
> + if (err)
> + return dev_err_probe(dev, err, "Failed to read chip ID\n");
'\n'
> + if (chip->whoami != chip_id)
> + return dev_err_probe(dev, -EINVAL, "Device reported wrong chip ID: %u\n",
"Unsupported chip"
> + chip_id);
How many chars does this take up if on one line?
Nit: If you have to break, break after the "-EINVAL" param.
> +
> + err = pm886_initialize_subregmaps(chip);
> + if (err)
> + return err;
> +
> + err = pm886_setup_irq(chip, &irq_data);
> + if (err)
> + return err;
> +
> + err = devm_mfd_add_devices(dev, 0, pm886_devs, ARRAY_SIZE(pm886_devs),
> + NULL, 0, regmap_irq_get_domain(irq_data));
> + if (err)
> + return dev_err_probe(dev, err, "Failed to add devices\n");
> +
> + err = devm_register_power_off_handler(dev, pm886_power_off_handler, chip);
> + if (err)
> + return dev_err_probe(dev, err, "Failed to register power off handler\n");
> +
> + device_init_wakeup(dev, device_property_read_bool(dev, "wakeup-source"));
> +
> + return 0;
> +}
> +
> +const struct of_device_id pm886_of_match[] = {
> + { .compatible = "marvell,88pm886-a1", .data = (void *)PM886_A1_CHIP_ID },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, pm886_of_match);
> +
> +static struct i2c_driver pm886_i2c_driver = {
> + .driver = {
> + .name = "88pm886",
> + .of_match_table = pm886_of_match,
> + },
> + .probe = pm886_probe,
> +};
> +module_i2c_driver(pm886_i2c_driver);
> +
> +MODULE_DESCRIPTION("Marvell 88PM886 PMIC driver");
> +MODULE_AUTHOR("Karel Balej <balejk@matfyz.cz>");
> +MODULE_LICENSE("GPL");
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index e7a6e45b9fac..9ef921c59f30 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -794,6 +794,18 @@ config MFD_88PM860X
> select individual components like voltage regulators, RTC and
> battery-charger under the corresponding menus.
>
> +config MFD_88PM886_PMIC
> + bool "Marvell 88PM886 PMIC"
> + depends on I2C=y
> + depends on OF
> + select REGMAP_I2C
> + select REGMAP_IRQ
> + select MFD_CORE
> + help
> + This enables support for Marvell 88PM886 Power Management IC.
> + This includes the I2C driver and the core APIs _only_, you have to
> + select individual components like onkey under the corresponding menus.
> +
> config MFD_MAX14577
> tristate "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
> depends on I2C
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index c66f07edcd0e..d016b7fed354 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -7,6 +7,7 @@
> obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o
> obj-$(CONFIG_MFD_88PM800) += 88pm800.o 88pm80x.o
> obj-$(CONFIG_MFD_88PM805) += 88pm805.o 88pm80x.o
> +obj-$(CONFIG_MFD_88PM886_PMIC) += 88pm886.o
> obj-$(CONFIG_MFD_ACT8945A) += act8945a.o
> obj-$(CONFIG_MFD_SM501) += sm501.o
> obj-$(CONFIG_ARCH_BCM2835) += bcm2835-pm.o
> diff --git a/include/linux/mfd/88pm886.h b/include/linux/mfd/88pm886.h
> new file mode 100644
> index 000000000000..c7527bab0fba
> --- /dev/null
> +++ b/include/linux/mfd/88pm886.h
> @@ -0,0 +1,46 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef __MFD_88PM886_H
> +#define __MFD_88PM886_H
> +
> +#include <linux/mfd/core.h>
What's this for?
> +#define PM886_A1_CHIP_ID 0xa1
> +
> +#define PM886_REG_ID 0x00
> +
> +#define PM886_REG_STATUS1 0x01
> +#define PM886_ONKEY_STS1 BIT(0)
> +
> +#define PM886_REG_MISC_CONFIG1 0x14
> +#define PM886_SW_PDOWN BIT(5)
> +
> +#define PM886_REG_MISC_CONFIG2 0x15
> +#define PM886_INT_INV BIT(0)
> +#define PM886_INT_CLEAR BIT(1)
> +#define PM886_INT_RC 0x00
> +#define PM886_INT_WC BIT(1)
> +#define PM886_INT_MASK_MODE BIT(2)
> +
> +#define PM886_PAGE_OFFSET_REGULATORS 1
> +
> +enum pm886_regulator_id {
> + PM886_REGULATOR_ID_LDO2,
> + PM886_REGULATOR_ID_LDO15,
> + PM886_REGULATOR_ID_BUCK2,
> +
> + PM886_REGULATOR_ID_SENTINEL
> +};
> +
> +enum pm886_regmap_index {
> + PM886_REGMAP_BASE,
> + PM886_REGMAP_REGULATORS,
> +
> + PM886_REGMAP_NR
> +};
> +
> +struct pm886_chip {
> + struct i2c_client *client;
> + unsigned int whoami;
chip_id
> + struct regmap *regmaps[PM886_REGMAP_NR];
> +};
> +#endif /* __MFD_88PM886_H */
> --
> 2.44.0
>
--
Lee Jones [李琼斯]
^ permalink raw reply
* Re: [PATCH 0/4] leds: trigger: Improve handling of led_trigger_event() and simplify mute audio trigger
From: Lee Jones @ 2024-03-05 12:08 UTC (permalink / raw)
To: Pavel Machek, Lee Jones, Jaroslav Kysela, Takashi Iwai,
Dmitry Torokhov, Thomas Bogendoerfer, Heiner Kallweit
Cc: linux-leds, linux-sound, open list:HID CORE LAYER, linux-mips
In-Reply-To: <30d49088-283c-40f3-b97b-fd5f5174a467@gmail.com>
On Tue, 13 Feb 2024 08:30:30 +0100, Heiner Kallweit wrote:
> If a simple trigger is assigned to a LED, then the LED may be off until
> the next led_trigger_event() call. This may be an issue for simple
> triggers with rare led_trigger_event() calls, e.g. power supply
> charging indicators (drivers/power/supply/power_supply_leds.c).
> Therefore persist the brightness value of the last led_trigger_event()
> call and use this value if the trigger is assigned to a LED.
> This change allows to use simple triggers in more cases.
> As a first use case simplify handling of the mute audio trigger.
>
> [...]
Applied, thanks!
[1/4] leds: trigger: Store brightness set by led_trigger_event()
commit: 575129855dee0e364af7df84a77ab5cca54b1442
[2/4] ALSA: control-led: Integrate mute led trigger
commit: ba8adb1646ee498029ac12b20e792d9d0dd17920
[3/4] Input: leds: Prepare for removal of config option LEDS_AUDIO_TRIGGER
(no commit info)
[4/4] leds: trigger: audio: Remove this trigger
(no commit info)
--
Lee Jones [李琼斯]
^ permalink raw reply
* Re: [PATCH v3 00/10] backlight: Replace struct fb_info in interfaces
From: Lee Jones @ 2024-03-05 14:53 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: andy, daniel.thompson, jingoohan1, deller, robin, javierm,
dri-devel, linux-fbdev, linux-input, linux-pwm
In-Reply-To: <20240305104459.GA86322@google.com>
On Tue, 05 Mar 2024, Lee Jones wrote:
> On Mon, 04 Mar 2024, Thomas Zimmermann wrote:
>
> > Backlight drivers implement struct backlight_ops.check_fb, which
> > uses struct fb_info in its interface. Replace the callback with one
> > that does not use fb_info.
> >
> > In DRM, we have several drivers that implement backlight support. By
> > including <linux/backlight.h> these drivers depend on <linux/fb.h>.
> > At the same time, fbdev is deprecated for new drivers and likely to
> > be replaced on many systems.
> >
> > This patchset is part of a larger effort to implement the backlight
> > code without depending on fbdev.
> >
> > Patch 1 makes the backlight core match backlight and framebuffer
> > devices via struct fb_info.bl_dev. Patches 2 to 9 then go through
> > drivers and remove unnecessary implementations of check_fb. Finally,
> > patch 10 replaces the check_fb hook with controls_device, which
> > uses the framebuffer's Linux device instead of the framebuffer.
> >
> > v3:
> > * hide CONFIG_FB_BACKLIGHT behind fb_bl_device() (Lee)
> > * if-else cleanups (Andy)
> > * fix commit message of patch 2 (Andy)
> > v2:
> > * fix hid-picolcd for CONFIG_FB_BACKLIGHT=n
> > * fixes to commit messages
> >
> > Thomas Zimmermann (10):
> > backlight: Match backlight device against struct fb_info.bl_dev
> > auxdisplay/ht16k33: Remove struct backlight_ops.check_fb
> > hid/hid-picolcd: Fix initialization order
> > hid/hid-picolcd: Remove struct backlight_ops.check_fb
> > backlight/aat2870-backlight: Remove struct backlight.check_fb
> > backlight/pwm-backlight: Remove struct backlight_ops.check_fb
> > fbdev/sh_mobile_lcdc_fb: Remove struct backlight_ops.check_fb
> > fbdev/ssd1307fb: Init backlight before registering framebuffer
> > fbdev/ssd1307fb: Remove struct backlight_ops.check_fb
> > backlight: Add controls_device callback to struct backlight_ops
> >
> > drivers/auxdisplay/ht16k33.c | 8 ------
> > drivers/hid/hid-picolcd_backlight.c | 7 ------
> > drivers/hid/hid-picolcd_core.c | 14 +++++------
> > drivers/hid/hid-picolcd_fb.c | 6 +++++
> > drivers/video/backlight/aat2870_bl.c | 7 ------
> > drivers/video/backlight/backlight.c | 8 ++++--
> > drivers/video/backlight/bd6107.c | 12 ++++-----
> > drivers/video/backlight/gpio_backlight.c | 12 ++++-----
> > drivers/video/backlight/lv5207lp.c | 12 ++++-----
> > drivers/video/backlight/pwm_bl.c | 12 ---------
> > drivers/video/fbdev/core/fb_backlight.c | 5 ++++
> > drivers/video/fbdev/sh_mobile_lcdcfb.c | 7 ------
> > drivers/video/fbdev/ssd1307fb.c | 31 +++++++++---------------
> > include/linux/backlight.h | 16 ++++++------
> > include/linux/fb.h | 9 +++++++
> > include/linux/pwm_backlight.h | 1 -
> > 16 files changed, 70 insertions(+), 97 deletions(-)
>
> All applied. Submitted for build testing.
>
> Will follow-up with a PR once that's passed.
In file included from /builds/linux/include/linux/backlight.h:13,
from /builds/linux/drivers/video/backlight/lp855x_bl.c:12:
/builds/linux/include/linux/fb.h:736:26: warning: no previous prototype for 'fb_bl_device' [-Wmissing-prototypes]
struct backlight_device *fb_bl_device(struct fb_info *info)
##########################
Errors were caused
[v6.8-rc1] ib-backlight-auxdisplay-hid-fb-6.8 7e508af663e20 ("backlight: Add controls_device callback to struct backlight_ops")
arc allnoconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOFnv6gFmUDNhk9qfBePj2N0/ Pass (0 errors - 1 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQhlmdHMnzDWy8bgy8Yhwp4b/ Pass (0 errors - 2 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arc allnoconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKKrZxZBeoUCAsVcKq7Im3B/ Pass (0 errors - 1 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQtDIJZ7rQPDViKMcsNEOgvR/ Pass (0 errors - 2 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arc axs101_defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOLZg1SwVMW2RAjIULk4qh65/ Pass (0 errors - 1 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQpsxuvbbnXzVO6TfUCzEbtW/ Fail (3 errors - 31 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arc hsdk_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOFgReAHQOVHiFozZbdQWn7l/ Pass (0 errors - 1 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQjUYkWfJ5thTdSZElfjJnQ2/ Fail (2 errors - 22 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arc tinyconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOD0gTB8Eoj9sqLm7eItgcw2/ Pass (0 errors - 1 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQjcwsTzF1TscpNtSmcOHfN8/ Pass (0 errors - 2 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arc tinyconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOLHB7Cd0OF48LwEHORZYUwC/ Pass (0 errors - 1 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQpQOjAX4HLQfDttdu7SGmCo/ Pass (0 errors - 2 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm64 allmodconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOJvNqgXUenz1S3BY8KEW8S8/ Fail (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQpLqwVSS5U9KFsvs4aihPWN/ Fail (9450 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm64 allmodconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOXeoVHzFSP6J4xI6S6f1jZB/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQpu5ujPvzKUvV3N2YvVlG37/ Fail (9450 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm64 allnoconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOMLAnQrN28HpvM436yUGptz/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQtT41KhGSq7E9oCIbXpmr0L/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm64 allnoconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOUECCIEuIC9qjtR2usPZVgr/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQyxt3hdpHhuhYMdJyAvz8T0/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm64 defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKTLSaqJNwPfX7rrqtMbjWQ/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQvoRqEQxDA9OPui9oEZY2Eh/ Fail (3 errors - 63 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm64 defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOSVqbxoqJ5ZlloM16u1j9uH/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR0ksfisbtdlWn5zidhfKgfG/ Fail (3 errors - 63 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm64 tinyconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOL2h9r84ReHNsQbFWdYb9zA/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQtg2U3DMmhrx5XZjhMzLvaK/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm64 tinyconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOX0H8ClYysl2wGU5FXeqStj/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQyP560IGFjrOVkI1wzH3Mdm/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm allnoconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOL0yb08iiVb3drd15ZjY9n9/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQi1aUmJ9H8cQEhcTpGF5B2O/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm allnoconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOJn5VKF99ZsIeyzXcYFO7C4/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQrGOAirtIXiCS166B7sq73F/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm bcm2835_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKFaEb1Lan8L82nDqdOCBaE/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQkhxNsajVdPofEcQrhbEqh1/ Fail (181 errors - 31 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm bcm2835_defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOVvc8VYa7ynzXPRaDBhw7L7/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQqthXPr0GiiZCpN2awTiCvm/ Fail (181 errors - 31 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm exynos_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOJxJLpW84g2Y2ygYhjTCS7D/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQlfcaTd744gHsEQZQ7kju8U/ Fail (125 errors - 38 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm exynos_defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOSAzoCZZvh08E7IdX902i8m/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQuDstveo2iHo2LcLJwNSdZI/ Fail (125 errors - 38 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm hisi_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXONgXlcrobSvs8vkdY9VbqsX/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQs3F7nkztLdqLQTO3TvN0Fp/ Fail (0 errors - 5 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm hisi_defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOXFSwRBq2bGw0OalI9CP8sH/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQsvaNlkPx3Pz4mTNb3aHyJt/ Fail (0 errors - 5 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm qcom_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKSmcS9QdzxGDbmsWMMXDVV/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQqFN1R07pYGNMP0ZNgTKL4h/ Fail (3 errors - 34 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm qcom_defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOWVygTuMUJ0QqsqxbVro5tS/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQrgWUUTbt9WBGVEYYySdKKT/ Fail (3 errors - 34 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm rpc_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOP5kio8OZ4hBaLiqKTH638B/ Pass (0 errors - 8 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQqBxPgWkDVQOvoZbVXVEJUk/ Fail (46 errors - 30 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm tinyconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOOrIT03LWNJBYy4I7SZZLwo/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQl5K1AcAa4uLbJ4mSP46vji/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm tinyconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOP8UPgUANWxizuVLJ5RFrOh/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQrScpCj7WUtQ7hEoerry89n/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm u8500_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOOTc4fY8ZVksLpu4B0Cept6/ Pass (0 errors - 1 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQucBv9mphTfIec2iCoO7FAA/ Fail (17 errors - 39 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
arm u8500_defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOVlcdE6uJPJpjrW4D0i2Zea/ Pass (0 errors - 1 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQuddQgdScLgr7z1yjLtU9kE/ Fail (17 errors - 39 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
i386 i386_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOQXYkIEKnb3F9LjpG1Sy9iW/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQuJhoRWFU4ScPBfrw1cXua3/ Fail (20 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
i386 i386_defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOX6NMFqS3YRL2NvLkZoA1HB/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR29cg5J4k4ks6lDKIq6rFos/ Fail (20 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
mips allnoconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKPoYSFZYdBRYlkK3t7dqB6/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQripL0vUGBKFPyFk3uKScQF/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
mips allnoconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOTLX4kx8Zrggtb3HIhoEQUo/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR2Sq0jeTq61n7ZNAmNjkvA2/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
mips cu1000-neo_defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXORDLo8D5VpJTcjyzCDiq4uI/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR2oyxBTN2eie0N1bZ8nbRn3/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
mips qi_lb60_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOMInwFyDNM7Dz60GHmKD92A/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQpuRsIk3nCg2M4UygGXYznA/ Fail (2 errors - 7 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
mips qi_lb60_defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOWgX0mWwhL4C4odKOlhykGO/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQzOCWgsfADTGWZDAmjSwwI7/ Fail (2 errors - 7 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
mips tinyconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOJxQ6uBNx3rqvHJUB9jYmfI/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQw5sOQ3Pk2B3ClS9jZvaBmY/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
mips tinyconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOTjzBn19txhKK68byvdMnI3/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR3a7PmtE6m7zobe9vSArMjp/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
mips xilfpga_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOQp85uaxAauoKtAIWshN254/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQtRlZoiImIidUOtNfW9EM2F/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
powerpc allmodconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKZUZ4luBNDCJNLUgqOnVe8/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQsnc4xsG2u2ixGczVQDpyCU/ Fail (9005 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
powerpc allmodconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOYdyNpKcalGcP2YntdEk1IA/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR0Ua9sytZxT839zEgXRNCMj/ Fail (9005 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
powerpc allnoconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXONTngxZkx4CkQWFCiOfwg70/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQrbRjTyt95ltP3t1MxzrYh1/ Fail (1 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
powerpc allnoconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOTEfkQyCRHEOzbbOH0afLAh/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQz0clzBdEy0qhFTh2IEu00a/ Fail (1 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
powerpc tinyconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOPIu7RaL9aDGJ8pkSZv4bMR/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQsyReY2GIrGfYLSxlOWZ74f/ Fail (1 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
powerpc tinyconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOU2QIY0zQXtGZ5mIV3UQ5x1/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR2f4C7iZbU6gca36QRf8xzz/ Fail (1 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
x86_64 allmodconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOOdlotTccsa3jUsMw0mEMqK/ Pass (0 errors - 2 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQptW04gBeDYysPHUVtKxrzA/ Fail (9781 errors - 2 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
x86_64 allmodconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOV5o3OJ8cjSaaRKbPMwxRDb/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQzKo3q53SPT2S4dgai8cAlU/ Fail (9781 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
x86_64 x86_64_defconfig gcc-8
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOO41yqQgH7KziVn2oV8KNWq/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQutvDXWLAAjvOY80xsf1wgQ/ Fail (20 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
x86_64 x86_64_defconfig gcc-9
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOUPQnMxIxbqO1K7t3oCexeC/ Pass (0 errors - 0 warnings) : v6.8-rc1
https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQxFJaNzNzrfUj974h9F1nmG/ Fail (20 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
--
Lee Jones [李琼斯]
^ permalink raw reply
* Re: [PATCH v3 00/10] backlight: Replace struct fb_info in interfaces
From: Thomas Zimmermann @ 2024-03-05 16:04 UTC (permalink / raw)
To: Lee Jones
Cc: andy, daniel.thompson, jingoohan1, deller, robin, javierm,
dri-devel, linux-fbdev, linux-input, linux-pwm
In-Reply-To: <20240305145325.GF86322@google.com>
Am 05.03.24 um 15:53 schrieb Lee Jones:
> On Tue, 05 Mar 2024, Lee Jones wrote:
>
>> On Mon, 04 Mar 2024, Thomas Zimmermann wrote:
>>
>>> Backlight drivers implement struct backlight_ops.check_fb, which
>>> uses struct fb_info in its interface. Replace the callback with one
>>> that does not use fb_info.
>>>
>>> In DRM, we have several drivers that implement backlight support. By
>>> including <linux/backlight.h> these drivers depend on <linux/fb.h>.
>>> At the same time, fbdev is deprecated for new drivers and likely to
>>> be replaced on many systems.
>>>
>>> This patchset is part of a larger effort to implement the backlight
>>> code without depending on fbdev.
>>>
>>> Patch 1 makes the backlight core match backlight and framebuffer
>>> devices via struct fb_info.bl_dev. Patches 2 to 9 then go through
>>> drivers and remove unnecessary implementations of check_fb. Finally,
>>> patch 10 replaces the check_fb hook with controls_device, which
>>> uses the framebuffer's Linux device instead of the framebuffer.
>>>
>>> v3:
>>> * hide CONFIG_FB_BACKLIGHT behind fb_bl_device() (Lee)
>>> * if-else cleanups (Andy)
>>> * fix commit message of patch 2 (Andy)
>>> v2:
>>> * fix hid-picolcd for CONFIG_FB_BACKLIGHT=n
>>> * fixes to commit messages
>>>
>>> Thomas Zimmermann (10):
>>> backlight: Match backlight device against struct fb_info.bl_dev
>>> auxdisplay/ht16k33: Remove struct backlight_ops.check_fb
>>> hid/hid-picolcd: Fix initialization order
>>> hid/hid-picolcd: Remove struct backlight_ops.check_fb
>>> backlight/aat2870-backlight: Remove struct backlight.check_fb
>>> backlight/pwm-backlight: Remove struct backlight_ops.check_fb
>>> fbdev/sh_mobile_lcdc_fb: Remove struct backlight_ops.check_fb
>>> fbdev/ssd1307fb: Init backlight before registering framebuffer
>>> fbdev/ssd1307fb: Remove struct backlight_ops.check_fb
>>> backlight: Add controls_device callback to struct backlight_ops
>>>
>>> drivers/auxdisplay/ht16k33.c | 8 ------
>>> drivers/hid/hid-picolcd_backlight.c | 7 ------
>>> drivers/hid/hid-picolcd_core.c | 14 +++++------
>>> drivers/hid/hid-picolcd_fb.c | 6 +++++
>>> drivers/video/backlight/aat2870_bl.c | 7 ------
>>> drivers/video/backlight/backlight.c | 8 ++++--
>>> drivers/video/backlight/bd6107.c | 12 ++++-----
>>> drivers/video/backlight/gpio_backlight.c | 12 ++++-----
>>> drivers/video/backlight/lv5207lp.c | 12 ++++-----
>>> drivers/video/backlight/pwm_bl.c | 12 ---------
>>> drivers/video/fbdev/core/fb_backlight.c | 5 ++++
>>> drivers/video/fbdev/sh_mobile_lcdcfb.c | 7 ------
>>> drivers/video/fbdev/ssd1307fb.c | 31 +++++++++---------------
>>> include/linux/backlight.h | 16 ++++++------
>>> include/linux/fb.h | 9 +++++++
>>> include/linux/pwm_backlight.h | 1 -
>>> 16 files changed, 70 insertions(+), 97 deletions(-)
>> All applied. Submitted for build testing.
>>
>> Will follow-up with a PR once that's passed.
> In file included from /builds/linux/include/linux/backlight.h:13,
> from /builds/linux/drivers/video/backlight/lp855x_bl.c:12:
> /builds/linux/include/linux/fb.h:736:26: warning: no previous prototype for 'fb_bl_device' [-Wmissing-prototypes]
> struct backlight_device *fb_bl_device(struct fb_info *info)
Thanks. I'll investigate and send an update. Sorry for that issue.
Best regards
Thomas
>
> ##########################
>
> Errors were caused
>
> [v6.8-rc1] ib-backlight-auxdisplay-hid-fb-6.8 7e508af663e20 ("backlight: Add controls_device callback to struct backlight_ops")
>
> arc allnoconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOFnv6gFmUDNhk9qfBePj2N0/ Pass (0 errors - 1 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQhlmdHMnzDWy8bgy8Yhwp4b/ Pass (0 errors - 2 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arc allnoconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKKrZxZBeoUCAsVcKq7Im3B/ Pass (0 errors - 1 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQtDIJZ7rQPDViKMcsNEOgvR/ Pass (0 errors - 2 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arc axs101_defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOLZg1SwVMW2RAjIULk4qh65/ Pass (0 errors - 1 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQpsxuvbbnXzVO6TfUCzEbtW/ Fail (3 errors - 31 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arc hsdk_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOFgReAHQOVHiFozZbdQWn7l/ Pass (0 errors - 1 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQjUYkWfJ5thTdSZElfjJnQ2/ Fail (2 errors - 22 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arc tinyconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOD0gTB8Eoj9sqLm7eItgcw2/ Pass (0 errors - 1 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQjcwsTzF1TscpNtSmcOHfN8/ Pass (0 errors - 2 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arc tinyconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOLHB7Cd0OF48LwEHORZYUwC/ Pass (0 errors - 1 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQpQOjAX4HLQfDttdu7SGmCo/ Pass (0 errors - 2 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm64 allmodconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOJvNqgXUenz1S3BY8KEW8S8/ Fail (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQpLqwVSS5U9KFsvs4aihPWN/ Fail (9450 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm64 allmodconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOXeoVHzFSP6J4xI6S6f1jZB/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQpu5ujPvzKUvV3N2YvVlG37/ Fail (9450 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm64 allnoconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOMLAnQrN28HpvM436yUGptz/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQtT41KhGSq7E9oCIbXpmr0L/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm64 allnoconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOUECCIEuIC9qjtR2usPZVgr/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQyxt3hdpHhuhYMdJyAvz8T0/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm64 defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKTLSaqJNwPfX7rrqtMbjWQ/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQvoRqEQxDA9OPui9oEZY2Eh/ Fail (3 errors - 63 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm64 defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOSVqbxoqJ5ZlloM16u1j9uH/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR0ksfisbtdlWn5zidhfKgfG/ Fail (3 errors - 63 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm64 tinyconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOL2h9r84ReHNsQbFWdYb9zA/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQtg2U3DMmhrx5XZjhMzLvaK/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm64 tinyconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOX0H8ClYysl2wGU5FXeqStj/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQyP560IGFjrOVkI1wzH3Mdm/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm allnoconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOL0yb08iiVb3drd15ZjY9n9/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQi1aUmJ9H8cQEhcTpGF5B2O/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm allnoconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOJn5VKF99ZsIeyzXcYFO7C4/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQrGOAirtIXiCS166B7sq73F/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm bcm2835_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKFaEb1Lan8L82nDqdOCBaE/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQkhxNsajVdPofEcQrhbEqh1/ Fail (181 errors - 31 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm bcm2835_defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOVvc8VYa7ynzXPRaDBhw7L7/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQqthXPr0GiiZCpN2awTiCvm/ Fail (181 errors - 31 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm exynos_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOJxJLpW84g2Y2ygYhjTCS7D/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQlfcaTd744gHsEQZQ7kju8U/ Fail (125 errors - 38 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm exynos_defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOSAzoCZZvh08E7IdX902i8m/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQuDstveo2iHo2LcLJwNSdZI/ Fail (125 errors - 38 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm hisi_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXONgXlcrobSvs8vkdY9VbqsX/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQs3F7nkztLdqLQTO3TvN0Fp/ Fail (0 errors - 5 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm hisi_defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOXFSwRBq2bGw0OalI9CP8sH/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQsvaNlkPx3Pz4mTNb3aHyJt/ Fail (0 errors - 5 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm qcom_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKSmcS9QdzxGDbmsWMMXDVV/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQqFN1R07pYGNMP0ZNgTKL4h/ Fail (3 errors - 34 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm qcom_defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOWVygTuMUJ0QqsqxbVro5tS/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQrgWUUTbt9WBGVEYYySdKKT/ Fail (3 errors - 34 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm rpc_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOP5kio8OZ4hBaLiqKTH638B/ Pass (0 errors - 8 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQqBxPgWkDVQOvoZbVXVEJUk/ Fail (46 errors - 30 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm tinyconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOOrIT03LWNJBYy4I7SZZLwo/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQl5K1AcAa4uLbJ4mSP46vji/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm tinyconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOP8UPgUANWxizuVLJ5RFrOh/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQrScpCj7WUtQ7hEoerry89n/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm u8500_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOOTc4fY8ZVksLpu4B0Cept6/ Pass (0 errors - 1 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQucBv9mphTfIec2iCoO7FAA/ Fail (17 errors - 39 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> arm u8500_defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOVlcdE6uJPJpjrW4D0i2Zea/ Pass (0 errors - 1 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQuddQgdScLgr7z1yjLtU9kE/ Fail (17 errors - 39 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> i386 i386_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOQXYkIEKnb3F9LjpG1Sy9iW/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQuJhoRWFU4ScPBfrw1cXua3/ Fail (20 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> i386 i386_defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOX6NMFqS3YRL2NvLkZoA1HB/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR29cg5J4k4ks6lDKIq6rFos/ Fail (20 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> mips allnoconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKPoYSFZYdBRYlkK3t7dqB6/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQripL0vUGBKFPyFk3uKScQF/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> mips allnoconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOTLX4kx8Zrggtb3HIhoEQUo/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR2Sq0jeTq61n7ZNAmNjkvA2/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> mips cu1000-neo_defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXORDLo8D5VpJTcjyzCDiq4uI/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR2oyxBTN2eie0N1bZ8nbRn3/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> mips qi_lb60_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOMInwFyDNM7Dz60GHmKD92A/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQpuRsIk3nCg2M4UygGXYznA/ Fail (2 errors - 7 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> mips qi_lb60_defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOWgX0mWwhL4C4odKOlhykGO/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQzOCWgsfADTGWZDAmjSwwI7/ Fail (2 errors - 7 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> mips tinyconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOJxQ6uBNx3rqvHJUB9jYmfI/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQw5sOQ3Pk2B3ClS9jZvaBmY/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> mips tinyconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOTjzBn19txhKK68byvdMnI3/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR3a7PmtE6m7zobe9vSArMjp/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> mips xilfpga_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOQp85uaxAauoKtAIWshN254/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQtRlZoiImIidUOtNfW9EM2F/ Pass (0 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> powerpc allmodconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOKZUZ4luBNDCJNLUgqOnVe8/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQsnc4xsG2u2ixGczVQDpyCU/ Fail (9005 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> powerpc allmodconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOYdyNpKcalGcP2YntdEk1IA/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR0Ua9sytZxT839zEgXRNCMj/ Fail (9005 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> powerpc allnoconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXONTngxZkx4CkQWFCiOfwg70/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQrbRjTyt95ltP3t1MxzrYh1/ Fail (1 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> powerpc allnoconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOTEfkQyCRHEOzbbOH0afLAh/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQz0clzBdEy0qhFTh2IEu00a/ Fail (1 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> powerpc tinyconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOPIu7RaL9aDGJ8pkSZv4bMR/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQsyReY2GIrGfYLSxlOWZ74f/ Fail (1 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> powerpc tinyconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOU2QIY0zQXtGZ5mIV3UQ5x1/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXR2f4C7iZbU6gca36QRf8xzz/ Fail (1 errors - 1 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> x86_64 allmodconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOOdlotTccsa3jUsMw0mEMqK/ Pass (0 errors - 2 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQptW04gBeDYysPHUVtKxrzA/ Fail (9781 errors - 2 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> x86_64 allmodconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOV5o3OJ8cjSaaRKbPMwxRDb/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQzKo3q53SPT2S4dgai8cAlU/ Fail (9781 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> x86_64 x86_64_defconfig gcc-8
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOO41yqQgH7KziVn2oV8KNWq/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQutvDXWLAAjvOY80xsf1wgQ/ Fail (20 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
> x86_64 x86_64_defconfig gcc-9
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXOUPQnMxIxbqO1K7t3oCexeC/ Pass (0 errors - 0 warnings) : v6.8-rc1
> https://storage.tuxsuite.com/public/google/lee.jones/builds/2dGXQxFJaNzNzrfUj974h9F1nmG/ Fail (20 errors - 0 warnings) : ib-backlight-auxdisplay-hid-fb-6.8
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
^ permalink raw reply
* [PATCH v4 00/10] backlight: Replace struct fb_info in interfaces
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann
Backlight drivers implement struct backlight_ops.check_fb, which
uses struct fb_info in its interface. Replace the callback with one
that does not use fb_info.
In DRM, we have several drivers that implement backlight support. By
including <linux/backlight.h> these drivers depend on <linux/fb.h>.
At the same time, fbdev is deprecated for new drivers and likely to
be replaced on many systems.
This patchset is part of a larger effort to implement the backlight
code without depending on fbdev.
Patch 1 makes the backlight core match backlight and framebuffer
devices via struct fb_info.bl_dev. Patches 2 to 9 then go through
drivers and remove unnecessary implementations of check_fb. Finally,
patch 10 replaces the check_fb hook with controls_device, which
uses the framebuffer's Linux device instead of the framebuffer.
v4:
* fix fb_bl_device() declaration and export
v3:
* hide CONFIG_FB_BACKLIGHT behind fb_bl_device() (Lee)
* if-else cleanups (Andy)
* fix commit message of patch 2 (Andy)
v2:
* fix hid-picolcd for CONFIG_FB_BACKLIGHT=n
* fixes to commit messages
Thomas Zimmermann (10):
backlight: Match backlight device against struct fb_info.bl_dev
auxdisplay/ht16k33: Remove struct backlight_ops.check_fb
hid/hid-picolcd: Fix initialization order
hid/hid-picolcd: Remove struct backlight_ops.check_fb
backlight/aat2870-backlight: Remove struct backlight.check_fb
backlight/pwm-backlight: Remove struct backlight_ops.check_fb
fbdev/sh_mobile_lcdc_fb: Remove struct backlight_ops.check_fb
fbdev/ssd1307fb: Init backlight before registering framebuffer
fbdev/ssd1307fb: Remove struct backlight_ops.check_fb
backlight: Add controls_device callback to struct backlight_ops
drivers/auxdisplay/ht16k33.c | 8 ------
drivers/hid/hid-picolcd_backlight.c | 7 ------
drivers/hid/hid-picolcd_core.c | 14 +++++------
drivers/hid/hid-picolcd_fb.c | 6 +++++
drivers/video/backlight/aat2870_bl.c | 7 ------
drivers/video/backlight/backlight.c | 8 ++++--
drivers/video/backlight/bd6107.c | 12 ++++-----
drivers/video/backlight/gpio_backlight.c | 12 ++++-----
drivers/video/backlight/lv5207lp.c | 12 ++++-----
drivers/video/backlight/pwm_bl.c | 12 ---------
drivers/video/fbdev/core/fb_backlight.c | 6 +++++
drivers/video/fbdev/sh_mobile_lcdcfb.c | 7 ------
drivers/video/fbdev/ssd1307fb.c | 31 +++++++++---------------
include/linux/backlight.h | 16 ++++++------
include/linux/fb.h | 9 +++++++
include/linux/pwm_backlight.h | 1 -
16 files changed, 71 insertions(+), 97 deletions(-)
--
2.44.0
^ permalink raw reply
* [PATCH v4 01/10] backlight: Match backlight device against struct fb_info.bl_dev
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann
In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de>
Framebuffer drivers for devices with dedicated backlight are supposed
to set struct fb_info.bl_dev to the backlight's respective device. Use
the value to match backlight and framebuffer in the backlight core code.
The code first tests against struct backlight_ops.check_ops. If this
test succeeds, it performs the test against fbdev. So backlight drivers
can override the later test as before.
Fbdev's backlight support depends on CONFIG_FB_BACKLIGHT. To avoid
ifdef in the code, the new helper fb_bl_device() returns the backlight
device, or NULL if the config option has been disabled. The test in
the backlight code will then do nothing.
v4:
* declare empty fb_bl_device() as static inline
* export fb_bl_device()
v3:
* hide ifdef in fb_bl_device() (Lee)
* no if-else blocks (Andy)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/video/backlight/backlight.c | 8 ++++++--
drivers/video/fbdev/core/fb_backlight.c | 6 ++++++
include/linux/fb.h | 9 +++++++++
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 86e1cdc8e3697..4f7973c6fcc79 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -98,7 +98,9 @@ static int fb_notifier_callback(struct notifier_block *self,
{
struct backlight_device *bd;
struct fb_event *evdata = data;
- int node = evdata->info->node;
+ struct fb_info *info = evdata->info;
+ struct backlight_device *fb_bd = fb_bl_device(info);
+ int node = info->node;
int fb_blank = 0;
/* If we aren't interested in this event, skip it immediately ... */
@@ -110,7 +112,9 @@ static int fb_notifier_callback(struct notifier_block *self,
if (!bd->ops)
goto out;
- if (bd->ops->check_fb && !bd->ops->check_fb(bd, evdata->info))
+ if (bd->ops->check_fb && !bd->ops->check_fb(bd, info))
+ goto out;
+ if (fb_bd && fb_bd != bd)
goto out;
fb_blank = *(int *)evdata->data;
diff --git a/drivers/video/fbdev/core/fb_backlight.c b/drivers/video/fbdev/core/fb_backlight.c
index e2d3b3adc870f..6fdaa9f81be90 100644
--- a/drivers/video/fbdev/core/fb_backlight.c
+++ b/drivers/video/fbdev/core/fb_backlight.c
@@ -30,4 +30,10 @@ void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max)
mutex_unlock(&fb_info->bl_curve_mutex);
}
EXPORT_SYMBOL_GPL(fb_bl_default_curve);
+
+struct backlight_device *fb_bl_device(struct fb_info *info)
+{
+ return info->bl_dev;
+}
+EXPORT_SYMBOL(fb_bl_device);
#endif
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 708e6a177b1be..15e91c04758c8 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -732,6 +732,15 @@ extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
extern void framebuffer_release(struct fb_info *info);
extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max);
+#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
+struct backlight_device *fb_bl_device(struct fb_info *info);
+#else
+static inline struct backlight_device *fb_bl_device(struct fb_info *info)
+{
+ return NULL;
+}
+#endif
+
/* fbmon.c */
#define FB_MAXTIMINGS 0
#define FB_VSYNCTIMINGS 1
--
2.44.0
^ permalink raw reply related
* [PATCH v4 02/10] auxdisplay/ht16k33: Remove struct backlight_ops.check_fb
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann
In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de>
The driver sets struct fb_info.bl_dev to the correct backlight
device. Thus rely on the backlight core code to match backlight
and framebuffer devices, and remove the extra check_fb() function
from struct backlight_ops.
v3:
* use 'check_fb()' in commit message (Andy)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Robin van der Gracht <robin@protonic.nl>
Acked-by: Robin van der Gracht <robin@protonic.nl>
Acked-by: Andy Shevchenko <andy@kernel.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/auxdisplay/ht16k33.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index a90430b7d07ba..0a858db32486b 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -325,16 +325,8 @@ static int ht16k33_bl_update_status(struct backlight_device *bl)
return ht16k33_brightness_set(priv, brightness);
}
-static int ht16k33_bl_check_fb(struct backlight_device *bl, struct fb_info *fi)
-{
- struct ht16k33_priv *priv = bl_get_data(bl);
-
- return (fi == NULL) || (fi->par == priv);
-}
-
static const struct backlight_ops ht16k33_bl_ops = {
.update_status = ht16k33_bl_update_status,
- .check_fb = ht16k33_bl_check_fb,
};
/*
--
2.44.0
^ permalink raw reply related
* [PATCH v4 03/10] hid/hid-picolcd: Fix initialization order
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann,
Bruno Prémont
In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de>
For drivers that support backlight, LCD and fbdev devices, fbdev has
to be initialized last. See documentation for struct fbinfo.bl_dev.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: "Bruno Prémont" <bonbons@linux-vserver.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/hid/hid-picolcd_core.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c
index bbda231a7ce30..5ddebe25eb91f 100644
--- a/drivers/hid/hid-picolcd_core.c
+++ b/drivers/hid/hid-picolcd_core.c
@@ -474,11 +474,6 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data)
if (error)
goto err;
- /* Set up the framebuffer device */
- error = picolcd_init_framebuffer(data);
- if (error)
- goto err;
-
/* Setup lcd class device */
error = picolcd_init_lcd(data, picolcd_out_report(REPORT_CONTRAST, hdev));
if (error)
@@ -489,6 +484,11 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data)
if (error)
goto err;
+ /* Set up the framebuffer device */
+ error = picolcd_init_framebuffer(data);
+ if (error)
+ goto err;
+
/* Setup the LED class devices */
error = picolcd_init_leds(data, picolcd_out_report(REPORT_LED_STATE, hdev));
if (error)
@@ -502,9 +502,9 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data)
return 0;
err:
picolcd_exit_leds(data);
+ picolcd_exit_framebuffer(data);
picolcd_exit_backlight(data);
picolcd_exit_lcd(data);
- picolcd_exit_framebuffer(data);
picolcd_exit_cir(data);
picolcd_exit_keys(data);
return error;
@@ -623,9 +623,9 @@ static void picolcd_remove(struct hid_device *hdev)
/* Cleanup LED */
picolcd_exit_leds(data);
/* Clean up the framebuffer */
+ picolcd_exit_framebuffer(data);
picolcd_exit_backlight(data);
picolcd_exit_lcd(data);
- picolcd_exit_framebuffer(data);
/* Cleanup input */
picolcd_exit_cir(data);
picolcd_exit_keys(data);
--
2.44.0
^ permalink raw reply related
* [PATCH v4 05/10] backlight/aat2870-backlight: Remove struct backlight.check_fb
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann
In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de>
The driver's implementation of check_fb always returns true, which
is the default if no implementation has been set. So remove the code
from the driver.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/video/backlight/aat2870_bl.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c
index 81fde3abb92c4..b4c3354a1a8a6 100644
--- a/drivers/video/backlight/aat2870_bl.c
+++ b/drivers/video/backlight/aat2870_bl.c
@@ -12,7 +12,6 @@
#include <linux/platform_device.h>
#include <linux/mutex.h>
#include <linux/delay.h>
-#include <linux/fb.h>
#include <linux/backlight.h>
#include <linux/mfd/aat2870.h>
@@ -90,15 +89,9 @@ static int aat2870_bl_update_status(struct backlight_device *bd)
return 0;
}
-static int aat2870_bl_check_fb(struct backlight_device *bd, struct fb_info *fi)
-{
- return 1;
-}
-
static const struct backlight_ops aat2870_bl_ops = {
.options = BL_CORE_SUSPENDRESUME,
.update_status = aat2870_bl_update_status,
- .check_fb = aat2870_bl_check_fb,
};
static int aat2870_bl_probe(struct platform_device *pdev)
--
2.44.0
^ permalink raw reply related
* [PATCH v4 04/10] hid/hid-picolcd: Remove struct backlight_ops.check_fb
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann,
Bruno Prémont
In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de>
Update the driver to initialize struct fb_info.bl_dev to its backlight
device, if any. Thus rely on the backlight core code to match backlight
and framebuffer devices, and remove the extra check_fb function from
struct backlight_ops.
v2:
* protect against CONFIG_FB_BACKLIGHT (Javier, kernel test robot)
* reword commit message (Daniel)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: "Bruno Prémont" <bonbons@linux-vserver.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/hid/hid-picolcd_backlight.c | 7 -------
drivers/hid/hid-picolcd_fb.c | 6 ++++++
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/hid/hid-picolcd_backlight.c b/drivers/hid/hid-picolcd_backlight.c
index 5bd2a8c4bbd66..08d16917eb60b 100644
--- a/drivers/hid/hid-picolcd_backlight.c
+++ b/drivers/hid/hid-picolcd_backlight.c
@@ -9,7 +9,6 @@
#include <linux/hid.h>
-#include <linux/fb.h>
#include <linux/backlight.h>
#include "hid-picolcd.h"
@@ -39,15 +38,9 @@ static int picolcd_set_brightness(struct backlight_device *bdev)
return 0;
}
-static int picolcd_check_bl_fb(struct backlight_device *bdev, struct fb_info *fb)
-{
- return fb && fb == picolcd_fbinfo((struct picolcd_data *)bl_get_data(bdev));
-}
-
static const struct backlight_ops picolcd_blops = {
.update_status = picolcd_set_brightness,
.get_brightness = picolcd_get_brightness,
- .check_fb = picolcd_check_bl_fb,
};
int picolcd_init_backlight(struct picolcd_data *data, struct hid_report *report)
diff --git a/drivers/hid/hid-picolcd_fb.c b/drivers/hid/hid-picolcd_fb.c
index d7dddd99d325e..750206f5fc674 100644
--- a/drivers/hid/hid-picolcd_fb.c
+++ b/drivers/hid/hid-picolcd_fb.c
@@ -493,6 +493,12 @@ int picolcd_init_framebuffer(struct picolcd_data *data)
info->fix = picolcdfb_fix;
info->fix.smem_len = PICOLCDFB_SIZE*8;
+#ifdef CONFIG_FB_BACKLIGHT
+#ifdef CONFIG_HID_PICOLCD_BACKLIGHT
+ info->bl_dev = data->backlight;
+#endif
+#endif
+
fbdata = info->par;
spin_lock_init(&fbdata->lock);
fbdata->picolcd = data;
--
2.44.0
^ permalink raw reply related
* [PATCH v4 07/10] fbdev/sh_mobile_lcdc_fb: Remove struct backlight_ops.check_fb
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann
In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de>
The driver sets struct fb_info.bl_dev to the correct backlight
device. Thus rely on the backlight core code to match backlight
and framebuffer devices, and remove the extra check_fb function
from struct backlight_ops.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/video/fbdev/sh_mobile_lcdcfb.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index eb2297b37504c..bf34c8ec1a26c 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -2140,17 +2140,10 @@ static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev)
return ch->bl_brightness;
}
-static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
- struct fb_info *info)
-{
- return (info->bl_dev == bdev);
-}
-
static const struct backlight_ops sh_mobile_lcdc_bl_ops = {
.options = BL_CORE_SUSPENDRESUME,
.update_status = sh_mobile_lcdc_update_bl,
.get_brightness = sh_mobile_lcdc_get_brightness,
- .check_fb = sh_mobile_lcdc_check_fb,
};
static struct backlight_device *sh_mobile_lcdc_bl_probe(struct device *parent,
--
2.44.0
^ permalink raw reply related
* [PATCH v4 06/10] backlight/pwm-backlight: Remove struct backlight_ops.check_fb
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann,
Uwe Kleine-König
In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de>
The internal check_fb callback from struct pwm_bl_data is never
implemented. The driver's implementation of check_fb always
returns true, which is the backlight core's default if no
implementation has been set. So remove the code from the driver.
v2:
* reword commit message
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/video/backlight/pwm_bl.c | 12 ------------
include/linux/pwm_backlight.h | 1 -
2 files changed, 13 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index ffcebf6aa76a9..61d30bc98eea5 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -11,7 +11,6 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
-#include <linux/fb.h>
#include <linux/backlight.h>
#include <linux/err.h>
#include <linux/pwm.h>
@@ -34,7 +33,6 @@ struct pwm_bl_data {
int brightness);
void (*notify_after)(struct device *,
int brightness);
- int (*check_fb)(struct device *, struct fb_info *);
void (*exit)(struct device *);
};
@@ -129,17 +127,8 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
return 0;
}
-static int pwm_backlight_check_fb(struct backlight_device *bl,
- struct fb_info *info)
-{
- struct pwm_bl_data *pb = bl_get_data(bl);
-
- return !pb->check_fb || pb->check_fb(pb->dev, info);
-}
-
static const struct backlight_ops pwm_backlight_ops = {
.update_status = pwm_backlight_update_status,
- .check_fb = pwm_backlight_check_fb,
};
#ifdef CONFIG_OF
@@ -482,7 +471,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->notify = data->notify;
pb->notify_after = data->notify_after;
- pb->check_fb = data->check_fb;
pb->exit = data->exit;
pb->dev = &pdev->dev;
pb->enabled = false;
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index cdd2ac366bc72..0bf80e98d5b40 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -19,7 +19,6 @@ struct platform_pwm_backlight_data {
int (*notify)(struct device *dev, int brightness);
void (*notify_after)(struct device *dev, int brightness);
void (*exit)(struct device *dev);
- int (*check_fb)(struct device *dev, struct fb_info *info);
};
#endif
--
2.44.0
^ permalink raw reply related
* [PATCH v4 09/10] fbdev/ssd1307fb: Remove struct backlight_ops.check_fb
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann
In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de>
The driver sets struct fb_info.bl_dev to the correct backlight
device. Thus rely on the backlight core code to match backlight
and framebuffer devices, and remove the extra check_fb function
from struct backlight_ops.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/video/fbdev/ssd1307fb.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index 0d1590c61eb06..3f30af3c059e0 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -530,17 +530,10 @@ static int ssd1307fb_get_brightness(struct backlight_device *bdev)
return par->contrast;
}
-static int ssd1307fb_check_fb(struct backlight_device *bdev,
- struct fb_info *info)
-{
- return (info->bl_dev == bdev);
-}
-
static const struct backlight_ops ssd1307fb_bl_ops = {
.options = BL_CORE_SUSPENDRESUME,
.update_status = ssd1307fb_update_bl,
.get_brightness = ssd1307fb_get_brightness,
- .check_fb = ssd1307fb_check_fb,
};
static struct ssd1307fb_deviceinfo ssd1307fb_ssd1305_deviceinfo = {
--
2.44.0
^ permalink raw reply related
* [PATCH v4 10/10] backlight: Add controls_device callback to struct backlight_ops
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann
In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de>
Replace check_fb with controls_device in struct backlight_ops. The
new callback interface takes a Linux device instead of a framebuffer.
Resolves one of the dependencies of backlight.h on fb.h.
The few drivers that had custom implementations of check_fb can easily
use the framebuffer's Linux device instead. Update them accordingly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/video/backlight/backlight.c | 2 +-
drivers/video/backlight/bd6107.c | 12 ++++++------
drivers/video/backlight/gpio_backlight.c | 12 ++++++------
drivers/video/backlight/lv5207lp.c | 12 ++++++------
include/linux/backlight.h | 16 ++++++++--------
5 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 4f7973c6fcc79..2bd4299206aef 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -112,7 +112,7 @@ static int fb_notifier_callback(struct notifier_block *self,
if (!bd->ops)
goto out;
- if (bd->ops->check_fb && !bd->ops->check_fb(bd, info))
+ if (bd->ops->controls_device && !bd->ops->controls_device(bd, info->device))
goto out;
if (fb_bd && fb_bd != bd)
goto out;
diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c
index c95a12bf0ce26..d124ede084ef9 100644
--- a/drivers/video/backlight/bd6107.c
+++ b/drivers/video/backlight/bd6107.c
@@ -99,18 +99,18 @@ static int bd6107_backlight_update_status(struct backlight_device *backlight)
return 0;
}
-static int bd6107_backlight_check_fb(struct backlight_device *backlight,
- struct fb_info *info)
+static bool bd6107_backlight_controls_device(struct backlight_device *backlight,
+ struct device *display_dev)
{
struct bd6107 *bd = bl_get_data(backlight);
- return !bd->pdata->dev || bd->pdata->dev == info->device;
+ return !bd->pdata->dev || bd->pdata->dev == display_dev;
}
static const struct backlight_ops bd6107_backlight_ops = {
- .options = BL_CORE_SUSPENDRESUME,
- .update_status = bd6107_backlight_update_status,
- .check_fb = bd6107_backlight_check_fb,
+ .options = BL_CORE_SUSPENDRESUME,
+ .update_status = bd6107_backlight_update_status,
+ .controls_device = bd6107_backlight_controls_device,
};
static int bd6107_probe(struct i2c_client *client)
diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
index d28c30b2a35d2..c0cff685ea848 100644
--- a/drivers/video/backlight/gpio_backlight.c
+++ b/drivers/video/backlight/gpio_backlight.c
@@ -30,18 +30,18 @@ static int gpio_backlight_update_status(struct backlight_device *bl)
return 0;
}
-static int gpio_backlight_check_fb(struct backlight_device *bl,
- struct fb_info *info)
+static bool gpio_backlight_controls_device(struct backlight_device *bl,
+ struct device *display_dev)
{
struct gpio_backlight *gbl = bl_get_data(bl);
- return !gbl->dev || gbl->dev == info->device;
+ return !gbl->dev || gbl->dev == display_dev;
}
static const struct backlight_ops gpio_backlight_ops = {
- .options = BL_CORE_SUSPENDRESUME,
- .update_status = gpio_backlight_update_status,
- .check_fb = gpio_backlight_check_fb,
+ .options = BL_CORE_SUSPENDRESUME,
+ .update_status = gpio_backlight_update_status,
+ .controls_device = gpio_backlight_controls_device,
};
static int gpio_backlight_probe(struct platform_device *pdev)
diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c
index 1f1d06b4e119a..0cf00fee0f605 100644
--- a/drivers/video/backlight/lv5207lp.c
+++ b/drivers/video/backlight/lv5207lp.c
@@ -62,18 +62,18 @@ static int lv5207lp_backlight_update_status(struct backlight_device *backlight)
return 0;
}
-static int lv5207lp_backlight_check_fb(struct backlight_device *backlight,
- struct fb_info *info)
+static bool lv5207lp_backlight_controls_device(struct backlight_device *backlight,
+ struct device *display_dev)
{
struct lv5207lp *lv = bl_get_data(backlight);
- return !lv->pdata->dev || lv->pdata->dev == info->device;
+ return !lv->pdata->dev || lv->pdata->dev == display_dev;
}
static const struct backlight_ops lv5207lp_backlight_ops = {
- .options = BL_CORE_SUSPENDRESUME,
- .update_status = lv5207lp_backlight_update_status,
- .check_fb = lv5207lp_backlight_check_fb,
+ .options = BL_CORE_SUSPENDRESUME,
+ .update_status = lv5207lp_backlight_update_status,
+ .controls_device = lv5207lp_backlight_controls_device,
};
static int lv5207lp_probe(struct i2c_client *client)
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index 614653e07e3a8..2db4c70053c46 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -13,6 +13,7 @@
#include <linux/fb.h>
#include <linux/mutex.h>
#include <linux/notifier.h>
+#include <linux/types.h>
/**
* enum backlight_update_reason - what method was used to update backlight
@@ -110,7 +111,6 @@ enum backlight_scale {
};
struct backlight_device;
-struct fb_info;
/**
* struct backlight_ops - backlight operations
@@ -160,18 +160,18 @@ struct backlight_ops {
int (*get_brightness)(struct backlight_device *);
/**
- * @check_fb: Check the framebuffer device.
+ * @controls_device: Check against the display device
*
- * Check if given framebuffer device is the one bound to this backlight.
- * This operation is optional and if not implemented it is assumed that the
- * fbdev is always the one bound to the backlight.
+ * Check if the backlight controls the given display device. This
+ * operation is optional and if not implemented it is assumed that
+ * the display is always the one controlled by the backlight.
*
* RETURNS:
*
- * If info is NULL or the info matches the fbdev bound to the backlight return true.
- * If info does not match the fbdev bound to the backlight return false.
+ * If display_dev is NULL or display_dev matches the device controlled by
+ * the backlight, return true. Otherwise return false.
*/
- int (*check_fb)(struct backlight_device *bd, struct fb_info *info);
+ bool (*controls_device)(struct backlight_device *bd, struct device *display_dev);
};
/**
--
2.44.0
^ permalink raw reply related
* [PATCH v4 08/10] fbdev/ssd1307fb: Init backlight before registering framebuffer
From: Thomas Zimmermann @ 2024-03-05 16:22 UTC (permalink / raw)
To: lee, andy, daniel.thompson, jingoohan1, deller, robin, javierm
Cc: dri-devel, linux-fbdev, linux-input, linux-pwm, Thomas Zimmermann
In-Reply-To: <20240305162425.23845-1-tzimmermann@suse.de>
For drivers that support backlight, LCD and fbdev devices, fbdev has
to be initialized last. See documentation for struct fbinfo.bl_dev.
The backlight name's index number comes from register_framebuffer(),
which now happens after initializing the backlight device. So like
in all other backlight drivers, we now give the backlight device a
generic name without the fbdev index.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/video/fbdev/ssd1307fb.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index 1a4f90ea7d5a8..0d1590c61eb06 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -594,7 +594,6 @@ static int ssd1307fb_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct backlight_device *bl;
- char bl_name[12];
struct fb_info *info;
struct fb_deferred_io *ssd1307fb_defio;
u32 vmem_size;
@@ -733,31 +732,30 @@ static int ssd1307fb_probe(struct i2c_client *client)
if (ret)
goto regulator_enable_error;
- ret = register_framebuffer(info);
- if (ret) {
- dev_err(dev, "Couldn't register the framebuffer\n");
- goto panel_init_error;
- }
-
- snprintf(bl_name, sizeof(bl_name), "ssd1307fb%d", info->node);
- bl = backlight_device_register(bl_name, dev, par, &ssd1307fb_bl_ops,
+ bl = backlight_device_register("ssd1307fb-bl", dev, par, &ssd1307fb_bl_ops,
NULL);
if (IS_ERR(bl)) {
ret = PTR_ERR(bl);
dev_err(dev, "unable to register backlight device: %d\n", ret);
- goto bl_init_error;
+ goto panel_init_error;
+ }
+ info->bl_dev = bl;
+
+ ret = register_framebuffer(info);
+ if (ret) {
+ dev_err(dev, "Couldn't register the framebuffer\n");
+ goto fb_init_error;
}
bl->props.brightness = par->contrast;
bl->props.max_brightness = MAX_CONTRAST;
- info->bl_dev = bl;
dev_info(dev, "fb%d: %s framebuffer device registered, using %d bytes of video memory\n", info->node, info->fix.id, vmem_size);
return 0;
-bl_init_error:
- unregister_framebuffer(info);
+fb_init_error:
+ backlight_device_unregister(bl);
panel_init_error:
pwm_disable(par->pwm);
pwm_put(par->pwm);
--
2.44.0
^ permalink raw reply related
* Re: [PATCH] Input: gpio_keys_polled - Suppress deferred probe error for gpio
From: Andy Shevchenko @ 2024-03-05 17:01 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Dmitry Torokhov, Linus Walleij, Krzysztof Kozlowski, linux-input,
kernel
In-Reply-To: <20240305101042.10953-2-u.kleine-koenig@pengutronix.de>
On Tue, Mar 5, 2024 at 12:10 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
...
> there are a few other exit paths that could use dev_err_probe(), but IIRC
> Dmitry isn't a fan of using dev_err_probe() where the return value cannot be
> EPROBE_DEFER, so I'm only changing this one error path.
It's not true anymore. He is fine with that API, and please use it.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH] Input: gpio_keys_polled - Suppress deferred probe error for gpio
From: Dmitry Torokhov @ 2024-03-05 17:11 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Uwe Kleine-König, Linus Walleij, Krzysztof Kozlowski,
linux-input, kernel
In-Reply-To: <CAHp75Vc2CePCjwvgwNNkccS6fYV1dZam25Rq__6wW1BUr5CFSQ@mail.gmail.com>
On Tue, Mar 05, 2024 at 07:01:02PM +0200, Andy Shevchenko wrote:
> On Tue, Mar 5, 2024 at 12:10 PM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
>
> ...
>
> > there are a few other exit paths that could use dev_err_probe(), but IIRC
> > Dmitry isn't a fan of using dev_err_probe() where the return value cannot be
> > EPROBE_DEFER, so I'm only changing this one error path.
>
> It's not true anymore. He is fine with that API, and please use it.
I would not get ahead of ourselves ;) I still think we could have done
this better by:
1. Having a format option for printing symbolic errors
2. Recording deferral source at supplier level
But yes, I am accepting patches and new drivers using dev_err_probe().
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: gpio_keys_polled - Suppress deferred probe error for gpio
From: Dmitry Torokhov @ 2024-03-05 17:15 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Linus Walleij, Krzysztof Kozlowski, Andy Shevchenko, linux-input,
kernel
In-Reply-To: <20240305101042.10953-2-u.kleine-koenig@pengutronix.de>
On Tue, Mar 05, 2024 at 11:10:42AM +0100, Uwe Kleine-König wrote:
> On a PC Engines APU our admins are faced with:
>
> $ dmesg | grep -c "gpio-keys-polled gpio-keys-polled: unable to claim gpio 0, err=-517"
> 261
>
> Such a message always appears when e.g. a new USB device is plugged in.
>
> Suppress this message which considerably clutters the kernel log for
> EPROBE_DEFER (i.e. -517).
I'll apply this, but that seems to be a misconfiguration somewhere - we
expect deferred probes to succeed eventually, here it looks like it
stays deferred forever and each time a new devices gets plugged in we
try to resolve deferred probe again and again.
Why doesn't gpio 0 become available?
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: ili210x: Allow IRQ to share GPIO
From: Dmitry Torokhov @ 2024-03-05 17:28 UTC (permalink / raw)
To: Adam Ford; +Cc: linux-input, aford, linux-kernel
In-Reply-To: <20240228114142.43803-1-aford173@gmail.com>
Hi Adam,
On Wed, Feb 28, 2024 at 05:41:42AM -0600, Adam Ford wrote:
> The IRQ registration currently assumes that the GPIO is
> dedicated to it, but that may not necessarily be the case.
> If the board has another device sharing the IRQ, it won't be
> registered and the touch detect fails.
I do not believe the driver is prepared to handle shared interrupts.
First of all, it disables interrupts in the firmware update path, which
will interfere with operation of other device using the same line.
You also need to make sure the driver properly recognizes condition when
interrupt is raised by another device and Ilitek controller does not
have any data to transfer/return. In this case we need to make sure we
do not log any errors, not release any active contacts, etc.
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: gpio_keys_polled - Suppress deferred probe error for gpio
From: Uwe Kleine-König @ 2024-03-05 17:41 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linus Walleij, Andy Shevchenko, Krzysztof Kozlowski, kernel,
linux-input
In-Reply-To: <ZedTGsn2LAoBMECf@google.com>
[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]
On Tue, Mar 05, 2024 at 09:15:06AM -0800, Dmitry Torokhov wrote:
> On Tue, Mar 05, 2024 at 11:10:42AM +0100, Uwe Kleine-König wrote:
> > On a PC Engines APU our admins are faced with:
> >
> > $ dmesg | grep -c "gpio-keys-polled gpio-keys-polled: unable to claim gpio 0, err=-517"
> > 261
> >
> > Such a message always appears when e.g. a new USB device is plugged in.
> >
> > Suppress this message which considerably clutters the kernel log for
> > EPROBE_DEFER (i.e. -517).
>
> I'll apply this, but that seems to be a misconfiguration somewhere - we
> expect deferred probes to succeed eventually, here it looks like it
> stays deferred forever and each time a new devices gets plugged in we
> try to resolve deferred probe again and again.
>
> Why doesn't gpio 0 become available?
This is an x86 machine and I don't even know why the device actually
exists. Also I have no idea what gpio 0 should be, there seems to be a
gpio controller[1], but its GPIO numbers start at 512.
I found a bug report about this this issue:
https://github.com/pcengines/apu2-documentation/issues/204
Anyhow, I think my patch is fine. I forwarded the bug report to my admin
who might or might not dig deeper.
Best regards and thanks,
Uwe
[1] /sys/devices/pci0000:00/AMD0030:00/gpio/gpiochip512
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH] dt-bindings: input: allwinner,sun4i-a10-lrad: drop redundant type from label
From: Dmitry Torokhov @ 2024-03-05 17:51 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Hans de Goede, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Maxime Ripard,
linux-input, devicetree, linux-arm-kernel, linux-sunxi,
linux-kernel
In-Reply-To: <20240226122934.89257-1-krzysztof.kozlowski@linaro.org>
On Mon, Feb 26, 2024 at 01:29:34PM +0100, Krzysztof Kozlowski wrote:
> dtschema defines label as string, so $ref in other bindings is
> redundant.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Applied, thank you.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: psmouse - add resync_on_resume dmi check
From: Dmitry Torokhov @ 2024-03-05 18:47 UTC (permalink / raw)
To: Jonathan Denose
Cc: LKML, jefferymiller, Jonathan Denose, Raul Rangel, linux-input
In-Reply-To: <CALNJtpWwhen2H9OT1-rZ4bt+huwXPOPz6qVDJ5g+emE1wRSLsw@mail.gmail.com>
On Mon, Mar 04, 2024 at 11:17:31AM -0600, Jonathan Denose wrote:
> I disabled the ideapad driver by rebuilding the kernel without the
> ideapad_laptop module. That does fix the suspend/resume issue!
>
> Attached are the logs. Is there a way to make this permanent?
Could you please try the patch below? Thanks!
---
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 9fbb8d31575a..2f0c143c3137 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -127,6 +127,7 @@ MODULE_PARM_DESC(unmask_kbd_data, "Unconditional enable (may reveal sensitive da
#endif
static bool i8042_present;
+static bool i8042_ready;
static bool i8042_bypass_aux_irq_test;
static char i8042_kbd_firmware_id[128];
static char i8042_aux_firmware_id[128];
@@ -190,6 +191,26 @@ void i8042_unlock_chip(void)
}
EXPORT_SYMBOL(i8042_unlock_chip);
+int i8042_device_link_add(struct device *consumer)
+{
+ if (!i8042_present)
+ return -ENODEV;
+
+ if (!i8042_platform_device || !i8042_ready)
+ return -EPROBE_DEFER;
+
+ return device_link_add(consumer, &i8042_platform_device->dev,
+ DL_FLAG_STATELESS) != NULL;
+}
+EXPORT_SYMBOL(i8042_device_link_add);
+
+void i8042_device_link_remove(struct device *consumer)
+{
+ if (i8042_platform_device)
+ device_link_remove(consumer, &i8042_platform_device->dev);
+}
+EXPORT_SYMBOL(i8042_device_link_remove);
+
int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
struct serio *serio))
{
@@ -1574,6 +1595,7 @@ static int i8042_probe(struct platform_device *dev)
*/
i8042_register_ports();
+ i8042_ready = true;
return 0;
out_fail:
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index ac037540acfc..d4d1bccbe882 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -1842,6 +1842,13 @@ static int ideapad_acpi_add(struct platform_device *pdev)
ideapad_register_rfkill(priv, i);
ideapad_sync_rfk_state(priv);
+
+ err = i8042_device_link_add(&pdev->dev);
+ if (err) {
+ dev_err(&pdev->dev, "failed to link with 8042 controller :%d", err);
+ goto i8042_link_failed;
+ }
+
ideapad_sync_touchpad_state(priv, false);
err = ideapad_dytc_profile_init(priv);
@@ -1882,7 +1889,9 @@ static int ideapad_acpi_add(struct platform_device *pdev)
backlight_failed:
ideapad_dytc_profile_exit(priv);
+ i8042_device_link_remove(&pdev->dev);
+i8042_link_failed:
for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++)
ideapad_unregister_rfkill(priv, i);
@@ -1909,6 +1918,7 @@ static void ideapad_acpi_remove(struct platform_device *pdev)
ideapad_backlight_exit(priv);
ideapad_dytc_profile_exit(priv);
+ i8042_device_link_remove(&pdev->dev);
for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++)
ideapad_unregister_rfkill(priv, i);
diff --git a/include/linux/i8042.h b/include/linux/i8042.h
index 95b07f8b77fe..ce45569f5246 100644
--- a/include/linux/i8042.h
+++ b/include/linux/i8042.h
@@ -52,12 +52,15 @@
#define I8042_CTR_AUXDIS 0x20
#define I8042_CTR_XLATE 0x40
+struct device;
struct serio;
#if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE)
void i8042_lock_chip(void);
void i8042_unlock_chip(void);
+int i8042_device_link_add(struct device *dev);
+void i8042_device_link_remove(struct device *dev);
int i8042_command(unsigned char *param, int command);
int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
struct serio *serio));
@@ -74,6 +77,15 @@ static inline void i8042_unlock_chip(void)
{
}
+int i8042_device_link_add(struct device *dev)
+{
+ return -ENODEV;
+}
+
+void i8042_device_link_remove(struct device *dev)
+{
+}
+
static inline int i8042_command(unsigned char *param, int command)
{
return -ENODEV;
Thanks.
--
Dmitry
^ permalink raw reply related
* Re: [RFC PATCH v3 2/5] mfd: add driver for Marvell 88PM886 PMIC
From: Karel Balej @ 2024-03-05 18:53 UTC (permalink / raw)
To: Lee Jones
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Dmitry Torokhov,
Liam Girdwood, Mark Brown, devicetree, linux-kernel, linux-input,
Duje Mihanović, ~postmarketos/upstreaming, phone-devel
In-Reply-To: <20240305114418.GB86322@google.com>
Lee Jones, 2024-03-05T11:44:18+00:00:
> > +static struct mfd_cell pm886_devs[] = {
> > + {
> > + .name = "88pm886-onkey",
> > + .num_resources = ARRAY_SIZE(pm886_onkey_resources),
> > + .resources = pm886_onkey_resources,
> > + },
> > + {
> > + .name = "88pm886-regulator",
> > + .id = PM886_REGULATOR_ID_LDO2,
>
> Why doesn't PLATFORM_DEVID_AUTO work for this device?
Because I am using the IDs in the regulator driver to determine which
regulator data to use/which regulator to register.
> > +static int pm886_initialize_subregmaps(struct pm886_chip *chip)
> > +{
> > + struct device *dev = &chip->client->dev;
> > + struct i2c_client *page;
> > + struct regmap *regmap;
> > + int err;
> > +
> > + /* regulators page */
> > + page = devm_i2c_new_dummy_device(dev, chip->client->adapter,
> > + chip->client->addr + PM886_PAGE_OFFSET_REGULATORS);
> > + if (IS_ERR(page)) {
> > + err = PTR_ERR(page);
> > + dev_err(dev, "Failed to initialize regulators client: %d\n", err);
> > + return err;
> > + }
> > + regmap = devm_regmap_init_i2c(page, &pm886_i2c_regmap);
> > + if (IS_ERR(regmap)) {
> > + err = PTR_ERR(regmap);
> > + dev_err(dev, "Failed to initialize regulators regmap: %d\n", err);
> > + return err;
> > + }
> > + chip->regmaps[PM886_REGMAP_REGULATORS] = regmap;
>
> Except for the regulator driver, where else is the regulators regmap used?
Nowhere, at least as of now. So you are saying that I should initialize
the regmap in the regulator driver?
Thank you,
K. B.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox