From patchwork Thu Jun 30 11:30:56 2016
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: backlight: Avoid double fbcon backlight handling
From: Chris Wilson <chris@chris-wilson.co.uk>
X-Patchwork-Id: 95769
Message-Id: <1467286256-8870-1-git-send-email-chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: Milo Kim <milo.kim@ti.com>, Krzysztof Kozlowski <k.kozlowski@samsung.com>,
David Airlie <airlied@linux.ie>, nouveau@lists.freedesktop.org,
Jon Nettleton <jon.nettleton@gmail.com>,
Nicolas Ferre <nicolas.ferre@atmel.com>, linux-fbdev@vger.kernel.org,
dri-devel@lists.freedesktop.org,
Thierry Reding <thierry.reding@gmail.com>,
Paul Mackerras <paulus@samba.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Daniel Vetter <daniel.vetter@intel.com>, Lee Jones <lee.jones@linaro.org>,
Daniel Drake <dsd@laptop.org>, Jens Frederich <jfrederich@gmail.com>,
linux-acpi@vger.kernel.org,
=?UTF-8?q?Bruno=20Pr=C3=A9mont?= <bonbons@linux-vserver.org>,
Tomi Valkeinen <tomi.valkeinen@ti.com>, Ben Skeggs <bskeggs@redhat.com>,
Zhang Rui <rui.zhang@intel.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Michael Hennerich <michael.hennerich@analog.com>,
Jiri Kosina <jikos@kernel.org>, linux-omap@vger.kernel.org,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Jingoo Han <jingoohan1@gmail.com>, linux-renesas-soc@vger.kernel.org,
=?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>,
Kukjin Kim <kgene@kernel.org>, Alex Deucher <alexander.deucher@amd.com>,
Antonino Daplas <adaplas@gmail.com>,
=?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
Date: Thu, 30 Jun 2016 12:30:56 +0100
Backlights controlled by i915.ko and only associated with its connectors
and also only associated with the intel_drmfb fbcon, controlled by
i915.ko. In this situation, we already handle adjusting the backlight
when the fbcon is blanked/unblanked and do not require backlight trying
to do the same.
Attempting to register with the fbdev as a client causes lockdep to warn
about a dependency cycle:
[ 18.983763] ======================================================
[ 18.983763] [ INFO: possible circular locking dependency detected ]
[ 18.983766] 4.7.0-rc5+ #524 Tainted: G O
[ 18.983767] -------------------------------------------------------
[ 18.983767] kworker/u8:0/6 is trying to acquire lock:
[ 18.983777] (&dev->mode_config.mutex){+.+.+.}, at: [<ffffffff815afde0>] drm_modeset_lock_all+0x40/0x120
[ 18.983777]
but task is already holding lock:
[ 18.983782] ((fb_notifier_list).rwsem){++++.+}, at: [<ffffffff810ac195>] __blocking_notifier_call_chain+0x35/0x70
[ 18.983783]
which lock already depends on the new lock.
[ 18.983783]
the existing dependency chain (in reverse order) is:
[ 18.983785]
-> #1 ((fb_notifier_list).rwsem){++++.+}:
[ 18.983789] [<ffffffff810df611>] lock_acquire+0xb1/0x200
[ 18.983792] [<ffffffff819a55b4>] down_write+0x44/0x80
[ 18.983795] [<ffffffff810abf91>] blocking_notifier_chain_register+0x21/0xb0
[ 18.983798] [<ffffffff814c7448>] fb_register_client+0x18/0x20
[ 18.983800] [<ffffffff814c6c86>] backlight_device_register+0x136/0x260
[ 18.983852] [<ffffffffa0127eb2>] intel_backlight_device_register+0xa2/0x160 [i915]
[ 18.983892] [<ffffffffa00f46be>] intel_connector_register+0xe/0x10 [i915]
[ 18.983932] [<ffffffffa0112bfb>] intel_dp_connector_register+0x1b/0x80 [i915]
[ 18.983936] [<ffffffff8159dfea>] drm_connector_register+0x4a/0x80
[ 18.983938] [<ffffffff8159fe44>] drm_connector_register_all+0x64/0xf0
[ 18.983940] [<ffffffff815a2a64>] drm_modeset_register_all+0x174/0x1c0
[ 18.983942] [<ffffffff81599b72>] drm_dev_register+0xc2/0xd0
[ 18.983976] [<ffffffffa00621d7>] i915_driver_load+0x1547/0x2200 [i915]
[ 18.984010] [<ffffffffa006d80f>] i915_pci_probe+0x4f/0x70 [i915]
[ 18.984014] [<ffffffff814a2135>] local_pci_probe+0x45/0xa0
[ 18.984015] [<ffffffff814a349b>] pci_device_probe+0xdb/0x130
[ 18.984018] [<ffffffff815c07e3>] driver_probe_device+0x223/0x440
[ 18.984020] [<ffffffff815c0ad5>] __driver_attach+0xd5/0x100
[ 18.984022] [<ffffffff815be386>] bus_for_each_dev+0x66/0xa0
[ 18.984023] [<ffffffff815c002e>] driver_attach+0x1e/0x20
[ 18.984025] [<ffffffff815bf9be>] bus_add_driver+0x1ee/0x280
[ 18.984028] [<ffffffff815c1810>] driver_register+0x60/0xe0
[ 18.984030] [<ffffffff814a1a10>] __pci_register_driver+0x60/0x70
[ 18.984063] [<ffffffffa01a905b>] i915_init+0x5b/0x62 [i915]
[ 18.984067] [<ffffffff8100042d>] do_one_initcall+0x3d/0x150
[ 18.984070] [<ffffffff811a935b>] do_init_module+0x5f/0x1d9
[ 18.984073] [<ffffffff81124416>] load_module+0x20e6/0x27e0
[ 18.984075] [<ffffffff81124d63>] SYSC_finit_module+0xc3/0xf0
[ 18.984076] [<ffffffff81124dae>] SyS_finit_module+0xe/0x10
[ 18.984079] [<ffffffff819a83a9>] entry_SYSCALL_64_fastpath+0x1c/0xac
[ 18.984081]
-> #0 (&dev->mode_config.mutex){+.+.+.}:
[ 18.984083] [<ffffffff810df0ac>] __lock_acquire+0x10fc/0x1260
[ 18.984085] [<ffffffff810df611>] lock_acquire+0xb1/0x200
[ 18.984088] [<ffffffff819a3097>] mutex_lock_nested+0x67/0x3c0
[ 18.984090] [<ffffffff815afde0>] drm_modeset_lock_all+0x40/0x120
[ 18.984093] [<ffffffff8158f79b>] drm_fb_helper_restore_fbdev_mode_unlocked+0x2b/0x80
[ 18.984095] [<ffffffff8158f81d>] drm_fb_helper_set_par+0x2d/0x50
[ 18.984134] [<ffffffffa0105f7a>] intel_fbdev_set_par+0x1a/0x60 [i915]
[ 18.984136] [<ffffffff814c13c6>] fbcon_init+0x586/0x610
[ 18.984139] [<ffffffff8154d16a>] visual_init+0xca/0x130
[ 18.984141] [<ffffffff8154e611>] do_bind_con_driver+0x1c1/0x3a0
[ 18.984143] [<ffffffff8154eaf6>] do_take_over_console+0x116/0x180
[ 18.984145] [<ffffffff814bd3a7>] do_fbcon_takeover+0x57/0xb0
[ 18.984147] [<ffffffff814c1e48>] fbcon_event_notify+0x658/0x750
[ 18.984150] [<ffffffff810abcae>] notifier_call_chain+0x3e/0xb0
[ 18.984152] [<ffffffff810ac1ad>] __blocking_notifier_call_chain+0x4d/0x70
[ 18.984154] [<ffffffff810ac1e6>] blocking_notifier_call_chain+0x16/0x20
[ 18.984156] [<ffffffff814c748b>] fb_notifier_call_chain+0x1b/0x20
[ 18.984158] [<ffffffff814c86b1>] register_framebuffer+0x251/0x330
[ 18.984160] [<ffffffff8158fa9f>] drm_fb_helper_initial_config+0x25f/0x3f0
[ 18.984199] [<ffffffffa0106b48>] intel_fbdev_initial_config+0x18/0x30 [i915]
[ 18.984201] [<ffffffff810adfd8>] async_run_entry_fn+0x48/0x150
[ 18.984203] [<ffffffff810a3947>] process_one_work+0x1e7/0x750
[ 18.984205] [<ffffffff810a3efb>] worker_thread+0x4b/0x4f0
[ 18.984207] [<ffffffff810aad4f>] kthread+0xef/0x110
[ 18.984208] [<ffffffff819a85ef>] ret_from_fork+0x1f/0x40
[ 18.984209]
other info that might help us debug this:
[ 18.984210] Possible unsafe locking scenario:
[ 18.984210] CPU0 CPU1
[ 18.984211] ---- ----
[ 18.984212] lock((fb_notifier_list).rwsem);
[ 18.984213] lock(&dev->mode_config.mutex);
[ 18.984215] lock((fb_notifier_list).rwsem);
[ 18.984216] lock(&dev->mode_config.mutex);
[ 18.984216]
*** DEADLOCK ***
[ 18.984217] 6 locks held by kworker/u8:0/6:
[ 18.984220] #0: ("events_unbound"){.+.+.+}, at: [<ffffffff810a38c9>] process_one_work+0x169/0x750
[ 18.984223] #1: ((&entry->work)){+.+.+.}, at: [<ffffffff810a38c9>] process_one_work+0x169/0x750
[ 18.984227] #2: (registration_lock){+.+.+.}, at: [<ffffffff814c8487>] register_framebuffer+0x27/0x330
[ 18.984231] #3: (console_lock){+.+.+.}, at: [<ffffffff814c86ce>] register_framebuffer+0x26e/0x330
[ 18.984234] #4: (&fb_info->lock){+.+.+.}, at: [<ffffffff814c78dd>] lock_fb_info+0x1d/0x40
[ 18.984238] #5: ((fb_notifier_list).rwsem){++++.+}, at: [<ffffffff810ac195>] __blocking_notifier_call_chain+0x35/0x70
[ 18.984238]
stack backtrace:
[ 18.984241] CPU: 2 PID: 6 Comm: kworker/u8:0 Tainted: G O 4.7.0-rc5+ #524
[ 18.984242] Hardware name: Intel Corp. Broxton P/NOTEBOOK, BIOS APLKRVPA.X64.0138.B33.1606250842 06/25/2016
[ 18.984244] Workqueue: events_unbound async_run_entry_fn
[ 18.984248] 0000000000000000 ffff8800758577f0 ffffffff814507a5 ffffffff828b9900
[ 18.984250] ffffffff828b9900 ffff880075857830 ffffffff810dc6fa ffff880075857880
[ 18.984252] ffff88007584d688 0000000000000005 0000000000000006 ffff88007584d6b0
[ 18.984253] Call Trace:
[ 18.984257] [<ffffffff814507a5>] dump_stack+0x67/0x92
[ 18.984259] [<ffffffff810dc6fa>] print_circular_bug+0x1aa/0x200
[ 18.984261] [<ffffffff810df0ac>] __lock_acquire+0x10fc/0x1260
[ 18.984264] [<ffffffff810df611>] lock_acquire+0xb1/0x200
[ 18.984266] [<ffffffff815afde0>] ? drm_modeset_lock_all+0x40/0x120
[ 18.984267] [<ffffffff815afde0>] ? drm_modeset_lock_all+0x40/0x120
[ 18.984269] [<ffffffff819a3097>] mutex_lock_nested+0x67/0x3c0
[ 18.984271] [<ffffffff815afde0>] ? drm_modeset_lock_all+0x40/0x120
[ 18.984273] [<ffffffff810fa85f>] ? rcu_read_lock_sched_held+0x7f/0x90
[ 18.984276] [<ffffffff81208218>] ? kmem_cache_alloc_trace+0x248/0x2b0
[ 18.984277] [<ffffffff815afdc5>] ? drm_modeset_lock_all+0x25/0x120
[ 18.984279] [<ffffffff815afde0>] drm_modeset_lock_all+0x40/0x120
[ 18.984281] [<ffffffff8158f79b>] drm_fb_helper_restore_fbdev_mode_unlocked+0x2b/0x80
[ 18.984283] [<ffffffff8158f81d>] drm_fb_helper_set_par+0x2d/0x50
[ 18.984322] [<ffffffffa0105f7a>] intel_fbdev_set_par+0x1a/0x60 [i915]
[ 18.984324] [<ffffffff814c13c6>] fbcon_init+0x586/0x610
[ 18.984326] [<ffffffff8154d16a>] visual_init+0xca/0x130
[ 18.984328] [<ffffffff8154e611>] do_bind_con_driver+0x1c1/0x3a0
[ 18.984330] [<ffffffff8154eaf6>] do_take_over_console+0x116/0x180
[ 18.984332] [<ffffffff814bd3a7>] do_fbcon_takeover+0x57/0xb0
[ 18.984334] [<ffffffff814c1e48>] fbcon_event_notify+0x658/0x750
[ 18.984336] [<ffffffff810abcae>] notifier_call_chain+0x3e/0xb0
[ 18.984338] [<ffffffff810ac1ad>] __blocking_notifier_call_chain+0x4d/0x70
[ 18.984340] [<ffffffff810ac1e6>] blocking_notifier_call_chain+0x16/0x20
[ 18.984342] [<ffffffff814c748b>] fb_notifier_call_chain+0x1b/0x20
[ 18.984344] [<ffffffff814c86b1>] register_framebuffer+0x251/0x330
[ 18.984347] [<ffffffff815b7e8d>] ? vga_switcheroo_client_fb_set+0x5d/0x70
[ 18.984349] [<ffffffff8158fa9f>] drm_fb_helper_initial_config+0x25f/0x3f0
[ 18.984388] [<ffffffffa0106b48>] intel_fbdev_initial_config+0x18/0x30 [i915]
[ 18.984389] [<ffffffff810adfd8>] async_run_entry_fn+0x48/0x150
[ 18.984391] [<ffffffff810a3947>] process_one_work+0x1e7/0x750
[ 18.984392] [<ffffffff810a38c9>] ? process_one_work+0x169/0x750
[ 18.984394] [<ffffffff810a3efb>] worker_thread+0x4b/0x4f0
[ 18.984396] [<ffffffff810a3eb0>] ? process_one_work+0x750/0x750
[ 18.984398] [<ffffffff810aad4f>] kthread+0xef/0x110
[ 18.984401] [<ffffffff819a85ef>] ret_from_fork+0x1f/0x40
[ 18.984402] [<ffffffff810aac60>] ? kthread_stop+0x2e0/0x2e0
Reported-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: "Bruno Prémont" <bonbons@linux-vserver.org>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Jens Frederich <jfrederich@gmail.com>
Cc: Daniel Drake <dsd@laptop.org>
Cc: Jon Nettleton <jon.nettleton@gmail.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Milo Kim <milo.kim@ti.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: linux-acpi@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Acked-by: Jani Nikula <jani.nikula@intel.com>
Tested-by: Imre Deak <imre.deak@intel.com>
---
drivers/acpi/acpi_video.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 3 ++-
drivers/gpu/drm/bridge/parade-ps8622.c | 3 ++-
drivers/gpu/drm/gma500/cdv_device.c | 3 ++-
drivers/gpu/drm/gma500/mdfld_device.c | 3 ++-
drivers/gpu/drm/gma500/oaktrail_device.c | 3 ++-
drivers/gpu/drm/gma500/psb_device.c | 3 ++-
drivers/gpu/drm/i915/intel_panel.c | 3 ++-
drivers/gpu/drm/nouveau/nouveau_backlight.c | 6 ++++--
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 3 ++-
.../gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 3 ++-
drivers/gpu/drm/radeon/atombios_encoders.c | 3 ++-
drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 3 ++-
drivers/gpu/drm/shmobile/shmob_drm_backlight.c | 3 ++-
drivers/hid/hid-picolcd_backlight.c | 3 ++-
drivers/macintosh/via-pmu-backlight.c | 3 ++-
drivers/platform/x86/acer-wmi.c | 3 ++-
drivers/platform/x86/apple-gmux.c | 3 ++-
drivers/platform/x86/asus-laptop.c | 3 ++-
drivers/platform/x86/asus-wmi.c | 3 ++-
drivers/platform/x86/classmate-laptop.c | 3 ++-
drivers/platform/x86/compal-laptop.c | 3 ++-
drivers/platform/x86/dell-laptop.c | 3 ++-
drivers/platform/x86/eeepc-laptop.c | 3 ++-
drivers/platform/x86/fujitsu-laptop.c | 3 ++-
drivers/platform/x86/ideapad-laptop.c | 3 ++-
drivers/platform/x86/intel_oaktrail.c | 3 ++-
drivers/platform/x86/msi-laptop.c | 3 ++-
drivers/platform/x86/msi-wmi.c | 3 ++-
drivers/platform/x86/panasonic-laptop.c | 3 ++-
drivers/platform/x86/samsung-laptop.c | 3 ++-
drivers/platform/x86/samsung-q10.c | 3 ++-
drivers/platform/x86/sony-laptop.c | 3 ++-
drivers/platform/x86/thinkpad_acpi.c | 3 ++-
drivers/platform/x86/toshiba_acpi.c | 3 ++-
drivers/staging/fbtft/fb_ssd1351.c | 3 ++-
drivers/staging/fbtft/fb_watterott.c | 3 ++-
drivers/staging/fbtft/fbtft-core.c | 3 ++-
drivers/staging/olpc_dcon/olpc_dcon.c | 3 ++-
drivers/usb/misc/appledisplay.c | 3 ++-
drivers/video/backlight/88pm860x_bl.c | 3 ++-
drivers/video/backlight/aat2870_bl.c | 3 ++-
drivers/video/backlight/adp5520_bl.c | 3 ++-
drivers/video/backlight/adp8860_bl.c | 3 ++-
drivers/video/backlight/adp8870_bl.c | 3 ++-
drivers/video/backlight/ams369fg06.c | 3 ++-
drivers/video/backlight/apple_bl.c | 3 ++-
drivers/video/backlight/as3711_bl.c | 3 ++-
drivers/video/backlight/backlight.c | 20 +++++++++++++-------
drivers/video/backlight/bd6107.c | 3 ++-
drivers/video/backlight/corgi_lcd.c | 3 ++-
drivers/video/backlight/cr_bllcd.c | 3 ++-
drivers/video/backlight/da903x_bl.c | 3 ++-
drivers/video/backlight/da9052_bl.c | 3 ++-
drivers/video/backlight/ep93xx_bl.c | 3 ++-
drivers/video/backlight/generic_bl.c | 3 ++-
drivers/video/backlight/gpio_backlight.c | 3 ++-
drivers/video/backlight/hp680_bl.c | 3 ++-
drivers/video/backlight/ipaq_micro_bl.c | 3 ++-
drivers/video/backlight/jornada720_bl.c | 3 ++-
drivers/video/backlight/kb3886_bl.c | 3 ++-
drivers/video/backlight/ld9040.c | 3 ++-
drivers/video/backlight/lm3533_bl.c | 3 ++-
drivers/video/backlight/lm3630a_bl.c | 6 ++++--
drivers/video/backlight/lm3639_bl.c | 3 ++-
drivers/video/backlight/locomolcd.c | 3 ++-
drivers/video/backlight/lp855x_bl.c | 3 ++-
drivers/video/backlight/lp8788_bl.c | 3 ++-
drivers/video/backlight/lv5207lp.c | 3 ++-
drivers/video/backlight/max8925_bl.c | 3 ++-
drivers/video/backlight/omap1_bl.c | 3 ++-
drivers/video/backlight/ot200_bl.c | 3 ++-
drivers/video/backlight/pandora_bl.c | 3 ++-
drivers/video/backlight/pcf50633-backlight.c | 3 ++-
drivers/video/backlight/pm8941-wled.c | 3 ++-
drivers/video/backlight/pwm_bl.c | 3 ++-
drivers/video/backlight/s6e63m0.c | 3 ++-
drivers/video/backlight/sky81452-backlight.c | 3 ++-
drivers/video/backlight/tosa_bl.c | 3 ++-
drivers/video/backlight/tps65217_bl.c | 3 ++-
drivers/video/backlight/wm831x_bl.c | 3 ++-
drivers/video/fbdev/atmel_lcdfb.c | 3 ++-
drivers/video/fbdev/aty/aty128fb.c | 3 ++-
drivers/video/fbdev/aty/atyfb_base.c | 3 ++-
drivers/video/fbdev/aty/radeon_backlight.c | 3 ++-
drivers/video/fbdev/bf537-lq035.c | 3 ++-
drivers/video/fbdev/bf54x-lq043fb.c | 3 ++-
drivers/video/fbdev/bfin-t350mcqb-fb.c | 3 ++-
drivers/video/fbdev/exynos/s6e8ax0.c | 3 ++-
drivers/video/fbdev/mx3fb.c | 3 ++-
drivers/video/fbdev/nvidia/nv_backlight.c | 3 ++-
.../video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 3 ++-
.../omap2/omapfb/displays/panel-sony-acx565akm.c | 3 ++-
drivers/video/fbdev/riva/fbdev.c | 3 ++-
drivers/video/fbdev/sh_mobile_lcdcfb.c | 3 ++-
drivers/video/fbdev/ssd1307fb.c | 3 ++-
include/linux/backlight.h | 7 +++++--
97 files changed, 212 insertions(+), 106 deletions(-)
@@ -1693,7 +1693,8 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
parent,
device,
&acpi_backlight_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
kfree(name);
if (IS_ERR(device->backlight)) {
device->backlight = NULL;
@@ -198,7 +198,8 @@ void amdgpu_atombios_encoder_init_backlight(struct amdgpu_encoder *amdgpu_encode
snprintf(bl_name, sizeof(bl_name),
"amdgpu_bl%d", dev->primary->index);
bd = backlight_device_register(bl_name, drm_connector->kdev,
- pdata, &amdgpu_atombios_encoder_backlight_ops, &props);
+ pdata, &amdgpu_atombios_encoder_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
DRM_ERROR("Backlight registration failed\n");
goto error;
@@ -608,7 +608,8 @@ static int ps8622_probe(struct i2c_client *client,
if (!of_find_property(dev->of_node, "use-external-pwm", NULL)) {
ps8622->bl = backlight_device_register("ps8622-backlight",
dev, ps8622, &ps8622_backlight_ops,
- NULL);
+ NULL,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(ps8622->bl)) {
DRM_ERROR("failed to register backlight\n");
ret = PTR_ERR(ps8622->bl);
@@ -163,7 +163,8 @@ static int cdv_backlight_init(struct drm_device *dev)
props.type = BACKLIGHT_PLATFORM;
cdv_backlight_device = backlight_device_register("psb-bl",
- NULL, (void *)dev, &cdv_ops, &props);
+ NULL, (void *)dev, &cdv_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(cdv_backlight_device))
return PTR_ERR(cdv_backlight_device);
@@ -130,7 +130,8 @@ static int mdfld_backlight_init(struct drm_device *dev)
props.max_brightness = BRIGHTNESS_MAX_LEVEL;
props.type = BACKLIGHT_PLATFORM;
mdfld_backlight_device = backlight_device_register("mdfld-bl",
- NULL, (void *)dev, &mdfld_ops, &props);
+ NULL, (void *)dev, &mdfld_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(mdfld_backlight_device))
return PTR_ERR(mdfld_backlight_device);
@@ -155,7 +155,8 @@ static int oaktrail_backlight_init(struct drm_device *dev)
props.type = BACKLIGHT_PLATFORM;
oaktrail_backlight_device = backlight_device_register("oaktrail-bl",
- NULL, (void *)dev, &oaktrail_ops, &props);
+ NULL, (void *)dev, &oaktrail_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(oaktrail_backlight_device))
return PTR_ERR(oaktrail_backlight_device);
@@ -131,7 +131,8 @@ static int psb_backlight_init(struct drm_device *dev)
props.type = BACKLIGHT_PLATFORM;
psb_backlight_device = backlight_device_register("psb-bl",
- NULL, (void *)dev, &psb_ops, &props);
+ NULL, (void *)dev, &psb_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(psb_backlight_device))
return PTR_ERR(psb_backlight_device);
@@ -1201,7 +1201,8 @@ int intel_backlight_device_register(struct intel_connector *connector)
backlight_device_register("intel_backlight",
connector->base.kdev,
connector,
- &intel_backlight_device_ops, &props);
+ &intel_backlight_device_ops, &props,
+ 0);
if (IS_ERR(panel->backlight.device)) {
DRM_ERROR("Failed to register backlight: %ld\n",
@@ -82,7 +82,8 @@ nv40_backlight_init(struct drm_connector *connector)
props.type = BACKLIGHT_RAW;
props.max_brightness = 31;
bd = backlight_device_register("nv_backlight", connector->kdev, drm,
- &nv40_bl_ops, &props);
+ &nv40_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd))
return PTR_ERR(bd);
drm->backlight = bd;
@@ -204,7 +205,8 @@ nv50_backlight_init(struct drm_connector *connector)
props.type = BACKLIGHT_RAW;
props.max_brightness = 100;
bd = backlight_device_register("nv_backlight", connector->kdev,
- nv_encoder, ops, &props);
+ nv_encoder, ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd))
return PTR_ERR(bd);
@@ -1260,7 +1260,8 @@ static int dsicm_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
bldev = backlight_device_register(dev_name(dev),
- dev, ddata, &dsicm_bl_ops, &props);
+ dev, ddata, &dsicm_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bldev)) {
r = PTR_ERR(bldev);
goto err_bl;
@@ -817,7 +817,8 @@ static int acx565akm_probe(struct spi_device *spi)
props.type = BACKLIGHT_RAW;
bldev = backlight_device_register("acx565akm", &ddata->spi->dev,
- ddata, &acx565akm_bl_ops, &props);
+ ddata, &acx565akm_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bldev)) {
r = PTR_ERR(bldev);
goto err_reg_bl;
@@ -214,7 +214,8 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
snprintf(bl_name, sizeof(bl_name),
"radeon_bl%d", dev->primary->index);
bd = backlight_device_register(bl_name, drm_connector->kdev,
- pdata, &radeon_atom_backlight_ops, &props);
+ pdata, &radeon_atom_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
DRM_ERROR("Backlight registration failed\n");
goto error;
@@ -393,7 +393,8 @@ void radeon_legacy_backlight_init(struct radeon_encoder *radeon_encoder,
snprintf(bl_name, sizeof(bl_name),
"radeon_bl%d", dev->primary->index);
bd = backlight_device_register(bl_name, drm_connector->kdev,
- pdata, &radeon_backlight_ops, &props);
+ pdata, &radeon_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
DRM_ERROR("Backlight registration failed\n");
goto error;
@@ -68,7 +68,8 @@ int shmob_drm_backlight_init(struct shmob_drm_connector *scon)
return 0;
backlight = backlight_device_register(bdata->name, dev->dev, scon,
- &shmob_drm_backlight_ops, NULL);
+ &shmob_drm_backlight_ops, NULL,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(backlight)) {
dev_err(dev->dev, "unable to register backlight device: %ld\n",
PTR_ERR(backlight));
@@ -77,7 +77,8 @@ int picolcd_init_backlight(struct picolcd_data *data, struct hid_report *report)
props.type = BACKLIGHT_RAW;
props.max_brightness = 0xff;
bdev = backlight_device_register(dev_name(dev), dev, data,
- &picolcd_blops, &props);
+ &picolcd_blops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bdev)) {
dev_err(dev, "failed to register backlight\n");
return PTR_ERR(bdev);
@@ -160,7 +160,8 @@ void __init pmu_backlight_init()
props.type = BACKLIGHT_PLATFORM;
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
printk(KERN_ERR "PMU Backlight registration failed\n");
return;
@@ -1419,7 +1419,8 @@ static int acer_backlight_init(struct device *dev)
props.type = BACKLIGHT_PLATFORM;
props.max_brightness = max_brightness;
bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
pr_err("Could not register Acer backlight device\n");
acer_backlight_device = NULL;
@@ -698,7 +698,8 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
props.max_brightness = GMUX_MAX_BRIGHTNESS;
bdev = backlight_device_register("gmux_backlight", &pnp->dev,
- gmux_data, &gmux_bl_ops, &props);
+ gmux_data, &gmux_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bdev)) {
ret = PTR_ERR(bdev);
goto err_release;
@@ -831,7 +831,8 @@ static int asus_backlight_init(struct asus_laptop *asus)
bd = backlight_device_register(ASUS_LAPTOP_FILE,
&asus->platform_device->dev, asus,
- &asusbl_ops, &props);
+ &asusbl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
pr_err("Could not register asus backlight device\n");
asus->backlight_device = NULL;
@@ -1565,7 +1565,8 @@ static int asus_wmi_backlight_init(struct asus_wmi *asus)
props.max_brightness = max;
bd = backlight_device_register(asus->driver->name,
&asus->platform_device->dev, asus,
- &asus_wmi_bl_ops, &props);
+ &asus_wmi_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
pr_err("Could not register backlight device\n");
return PTR_ERR(bd);
@@ -970,7 +970,8 @@ static int cmpc_ipml_add(struct acpi_device *acpi)
props.max_brightness = 7;
ipml->bd = backlight_device_register("cmpc_bl", &acpi->dev,
acpi->handle, &cmpc_bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(ipml->bd)) {
retval = PTR_ERR(ipml->bd);
goto out_bd;
@@ -1008,7 +1008,8 @@ static int __init compal_init(void)
compalbl_device = backlight_device_register(DRIVER_NAME,
NULL, NULL,
&compalbl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(compalbl_device))
return PTR_ERR(compalbl_device);
}
@@ -2035,7 +2035,8 @@ static int __init dell_init(void)
&platform_device->dev,
NULL,
&dell_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(dell_backlight_device)) {
ret = PTR_ERR(dell_backlight_device);
@@ -1159,7 +1159,8 @@ static int eeepc_backlight_init(struct eeepc_laptop *eeepc)
props.max_brightness = 15;
bd = backlight_device_register(EEEPC_LAPTOP_FILE,
&eeepc->platform_device->dev, eeepc,
- &eeepcbl_ops, &props);
+ &eeepcbl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
pr_err("Could not register eeepc backlight device\n");
eeepc->backlight_device = NULL;
@@ -1167,7 +1167,8 @@ static int __init fujitsu_init(void)
fujitsu->bl_device = backlight_device_register("fujitsu-laptop",
NULL, NULL,
&fujitsubl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(fujitsu->bl_device)) {
ret = PTR_ERR(fujitsu->bl_device);
fujitsu->bl_device = NULL;
@@ -726,7 +726,8 @@ static int ideapad_backlight_init(struct ideapad_private *priv)
&priv->platform_device->dev,
priv,
&ideapad_backlight_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(blightdev)) {
pr_err("Could not register backlight device\n");
return PTR_ERR(blightdev);
@@ -253,7 +253,8 @@ static int oaktrail_backlight_init(void)
bd = backlight_device_register(DRIVER_NAME,
&oaktrail_device->dev, NULL,
&oaktrail_bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
oaktrail_bl_device = NULL;
@@ -1078,7 +1078,8 @@ static int __init msi_init(void)
props.max_brightness = MSI_LCD_LEVEL_MAX - 1;
msibl_device = backlight_device_register("msi-laptop-bl", NULL,
NULL, &msibl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(msibl_device))
return PTR_ERR(msibl_device);
}
@@ -247,7 +247,8 @@ static int __init msi_wmi_backlight_setup(void)
props.max_brightness = ARRAY_SIZE(backlight_map) - 1;
backlight = backlight_device_register(DRV_NAME, NULL, NULL,
&msi_backlight_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(backlight))
return PTR_ERR(backlight);
@@ -618,7 +618,8 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
props.type = BACKLIGHT_PLATFORM;
props.max_brightness = pcc->sinf[SINF_AC_MAX_BRIGHT];
pcc->backlight = backlight_device_register("panasonic", NULL, pcc,
- &pcc_backlight_ops, &props);
+ &pcc_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(pcc->backlight)) {
result = PTR_ERR(pcc->backlight);
goto out_input;
@@ -1200,7 +1200,8 @@ static int __init samsung_backlight_init(struct samsung_laptop *samsung)
bd = backlight_device_register("samsung",
&samsung->platform_device->dev,
samsung, &backlight_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd))
return PTR_ERR(bd);
@@ -60,7 +60,8 @@ static int samsungq10_probe(struct platform_device *pdev)
props.type = BACKLIGHT_PLATFORM;
props.max_brightness = SAMSUNGQ10_BL_MAX_INTENSITY;
bd = backlight_device_register("samsung", &pdev->dev, NULL,
- &samsungq10_bl_ops, &props);
+ &samsungq10_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd))
return PTR_ERR(bd);
@@ -3158,7 +3158,8 @@ static void sony_nc_backlight_setup(void)
props.max_brightness = max_brightness;
sony_bl_props.dev = backlight_device_register("sony", NULL,
&sony_bl_props,
- ops, &props);
+ ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(sony_bl_props.dev)) {
pr_warn("unable to register backlight device\n");
@@ -6821,7 +6821,8 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
ibm_backlight_device = backlight_device_register(TPACPI_BACKLIGHT_DEV_NAME,
NULL, NULL,
&ibm_backlight_data,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(ibm_backlight_device)) {
int rc = PTR_ERR(ibm_backlight_device);
ibm_backlight_device = NULL;
@@ -2840,7 +2840,8 @@ static int toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev)
&dev->acpi_dev->dev,
dev,
&toshiba_backlight_data,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(dev->backlight_dev)) {
ret = PTR_ERR(dev->backlight_dev);
pr_err("Could not register toshiba backlight device\n");
@@ -210,7 +210,8 @@ static void register_onboard_backlight(struct fbtft_par *par)
bl_props.power = FB_BLANK_POWERDOWN;
bd = backlight_device_register(dev_driver_string(par->info->device),
- par->info->device, par, &bl_ops, &bl_props);
+ par->info->device, par, &bl_ops, &bl_props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
dev_err(par->info->device,
"cannot register backlight device (%ld)\n",
@@ -259,7 +259,8 @@ static void register_chip_backlight(struct fbtft_par *par)
bl_props.brightness = DEFAULT_BRIGHTNESS;
bd = backlight_device_register(dev_driver_string(par->info->device),
- par->info->device, par, &bl_ops, &bl_props);
+ par->info->device, par, &bl_ops, &bl_props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
dev_err(par->info->device,
"cannot register backlight device (%ld)\n",
@@ -299,7 +299,8 @@ void fbtft_register_backlight(struct fbtft_par *par)
bl_props.state |= BL_CORE_DRIVER1;
bd = backlight_device_register(dev_driver_string(par->info->device),
- par->info->device, par, &fbtft_bl_ops, &bl_props);
+ par->info->device, par, &fbtft_bl_ops, &bl_props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
dev_err(par->info->device,
"cannot register backlight device (%ld)\n",
@@ -643,7 +643,8 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
/* Add the backlight device for the DCON */
dcon_bl_props.brightness = dcon->bl_val;
dcon->bl_dev = backlight_device_register("dcon-bl", &dcon_device->dev,
- dcon, &dcon_bl_ops, &dcon_bl_props);
+ dcon, &dcon_bl_ops, &dcon_bl_props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(dcon->bl_dev)) {
dev_err(&client->dev, "cannot register backlight dev (%ld)\n",
PTR_ERR(dcon->bl_dev));
@@ -293,7 +293,8 @@ static int appledisplay_probe(struct usb_interface *iface,
props.type = BACKLIGHT_RAW;
props.max_brightness = 0xff;
pdata->bd = backlight_device_register(bl_name, NULL, pdata,
- &appledisplay_bl_data, &props);
+ &appledisplay_bl_data, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(pdata->bd)) {
dev_err(&iface->dev, "Backlight registration failed\n");
retval = PTR_ERR(pdata->bd);
@@ -242,7 +242,8 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
props.max_brightness = MAX_BRIGHTNESS;
bl = devm_backlight_device_register(&pdev->dev, name, &pdev->dev, data,
- &pm860x_backlight_ops, &props);
+ &pm860x_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
return PTR_ERR(bl);
@@ -152,7 +152,8 @@ static int aat2870_bl_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
bd = devm_backlight_device_register(&pdev->dev, "aat2870-backlight",
&pdev->dev, aat2870_bl, &aat2870_bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
dev_err(&pdev->dev,
"Failed allocate memory for backlight device\n");
@@ -315,7 +315,8 @@ static int adp5520_bl_probe(struct platform_device *pdev)
props.max_brightness = ADP5020_MAX_BRIGHTNESS;
bl = devm_backlight_device_register(&pdev->dev, pdev->name,
data->master, data, &adp5520_bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
return PTR_ERR(bl);
@@ -718,7 +718,8 @@ static int adp8860_probe(struct i2c_client *client,
bl = devm_backlight_device_register(&client->dev,
dev_driver_string(&client->dev),
- &client->dev, data, &adp8860_bl_ops, &props);
+ &client->dev, data, &adp8860_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&client->dev, "failed to register backlight\n");
return PTR_ERR(bl);
@@ -894,7 +894,8 @@ static int adp8870_probe(struct i2c_client *client,
props.max_brightness = props.brightness = ADP8870_MAX_BRIGHTNESS;
bl = devm_backlight_device_register(&client->dev,
dev_driver_string(&client->dev),
- &client->dev, data, &adp8870_bl_ops, &props);
+ &client->dev, data, &adp8870_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&client->dev, "failed to register backlight\n");
return PTR_ERR(bl);
@@ -484,7 +484,8 @@ static int ams369fg06_probe(struct spi_device *spi)
bd = devm_backlight_device_register(&spi->dev, "ams369fg06-bl",
&spi->dev, lcd,
- &ams369fg06_backlight_ops, &props);
+ &ams369fg06_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd))
return PTR_ERR(bd);
@@ -182,7 +182,8 @@ static int apple_bl_add(struct acpi_device *dev)
props.type = BACKLIGHT_PLATFORM;
props.max_brightness = 15;
apple_backlight_device = backlight_device_register("apple_backlight",
- NULL, NULL, &hw_data->backlight_ops, &props);
+ NULL, NULL, &hw_data->backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(apple_backlight_device)) {
release_region(hw_data->iostart, hw_data->iolen);
@@ -244,7 +244,8 @@ static int as3711_bl_register(struct platform_device *pdev,
su->type == AS3711_BL_SU1 ?
"as3711-su1" : "as3711-su2",
&pdev->dev, su,
- &as3711_bl_ops, &props);
+ &as3711_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
return PTR_ERR(bl);
@@ -319,13 +319,15 @@ EXPORT_SYMBOL(backlight_force_update);
* @devdata: an optional pointer to be stored for private driver use. The
* methods may retrieve it by using bl_get_data(bd).
* @ops: the backlight operations structure.
+ * @flags: bitmask to control backlight registration
*
* Creates and registers new backlight device. Returns either an
* ERR_PTR() or a pointer to the newly allocated device.
*/
struct backlight_device *backlight_device_register(const char *name,
struct device *parent, void *devdata, const struct backlight_ops *ops,
- const struct backlight_properties *props)
+ const struct backlight_properties *props,
+ unsigned long flags)
{
struct backlight_device *new_bd;
int rc;
@@ -363,10 +365,12 @@ struct backlight_device *backlight_device_register(const char *name,
return ERR_PTR(rc);
}
- rc = backlight_register_fb(new_bd);
- if (rc) {
- device_unregister(&new_bd->dev);
- return ERR_PTR(rc);
+ if (flags & BACKLIGHT_REGISTER_FB_CLIENT) {
+ rc = backlight_register_fb(new_bd);
+ if (rc) {
+ device_unregister(&new_bd->dev);
+ return ERR_PTR(rc);
+ }
}
new_bd->ops = ops;
@@ -494,6 +498,7 @@ EXPORT_SYMBOL(backlight_unregister_notifier);
* @devdata: an optional pointer to be stored for private driver use
* @ops: the backlight operations structure
* @props: the backlight properties
+ * @flags: bitmask to control backlight registration
*
* @return a struct backlight on success, or an ERR_PTR on error
*
@@ -504,7 +509,8 @@ EXPORT_SYMBOL(backlight_unregister_notifier);
struct backlight_device *devm_backlight_device_register(struct device *dev,
const char *name, struct device *parent, void *devdata,
const struct backlight_ops *ops,
- const struct backlight_properties *props)
+ const struct backlight_properties *props,
+ unsigned long flags)
{
struct backlight_device **ptr, *backlight;
@@ -514,7 +520,7 @@ struct backlight_device *devm_backlight_device_register(struct device *dev,
return ERR_PTR(-ENOMEM);
backlight = backlight_device_register(name, parent, devdata, ops,
- props);
+ props, flags);
if (!IS_ERR(backlight)) {
*ptr = backlight;
devres_add(dev, ptr);
@@ -163,7 +163,8 @@ static int bd6107_probe(struct i2c_client *client,
backlight = devm_backlight_device_register(&client->dev,
dev_name(&client->dev),
&bd->client->dev, bd,
- &bd6107_backlight_ops, &props);
+ &bd6107_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(backlight)) {
dev_err(&client->dev, "failed to register backlight\n");
return PTR_ERR(backlight);
@@ -562,7 +562,8 @@ static int corgi_lcd_probe(struct spi_device *spi)
props.max_brightness = pdata->max_intensity;
lcd->bl_dev = devm_backlight_device_register(&spi->dev, "corgi_bl",
&spi->dev, lcd, &corgi_bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(lcd->bl_dev))
return PTR_ERR(lcd->bl_dev);
@@ -197,7 +197,8 @@ static int cr_backlight_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
bdp = devm_backlight_device_register(&pdev->dev, "cr-backlight",
&pdev->dev, NULL, &cr_backlight_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bdp)) {
pci_dev_put(lpc_dev);
return PTR_ERR(bdp);
@@ -146,7 +146,8 @@ static int da903x_backlight_probe(struct platform_device *pdev)
props.max_brightness = max_brightness;
bl = devm_backlight_device_register(&pdev->dev, pdev->name,
data->da903x_dev, data,
- &da903x_backlight_ops, &props);
+ &da903x_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
return PTR_ERR(bl);
@@ -127,7 +127,8 @@ static int da9052_backlight_probe(struct platform_device *pdev)
bl = devm_backlight_device_register(&pdev->dev, pdev->name,
wleds->da9052->dev, wleds,
- &da9052_backlight_ops, &props);
+ &da9052_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "Failed to register backlight\n");
return PTR_ERR(bl);
@@ -93,7 +93,8 @@ static int ep93xxbl_probe(struct platform_device *dev)
props.type = BACKLIGHT_RAW;
props.max_brightness = EP93XX_MAX_BRIGHT;
bl = devm_backlight_device_register(&dev->dev, dev->name, &dev->dev,
- ep93xxbl, &ep93xxbl_ops, &props);
+ ep93xxbl, &ep93xxbl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl))
return PTR_ERR(bl);
@@ -76,7 +76,8 @@ static int genericbl_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
props.max_brightness = machinfo->max_intensity;
bd = devm_backlight_device_register(&pdev->dev, name, &pdev->dev,
- NULL, &genericbl_ops, &props);
+ NULL, &genericbl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd))
return PTR_ERR(bd);
@@ -132,7 +132,8 @@ static int gpio_backlight_probe(struct platform_device *pdev)
props.max_brightness = 1;
bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev),
&pdev->dev, gbl, &gpio_backlight_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
return PTR_ERR(bl);
@@ -111,7 +111,8 @@ static int hp680bl_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
props.max_brightness = HP680_MAX_INTENSITY;
bd = devm_backlight_device_register(&pdev->dev, "hp680-bl", &pdev->dev,
- NULL, &hp680bl_ops, &props);
+ NULL, &hp680bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd))
return PTR_ERR(bd);
@@ -60,7 +60,8 @@ static int micro_backlight_probe(struct platform_device *pdev)
bd = devm_backlight_device_register(&pdev->dev, "ipaq-micro-backlight",
&pdev->dev, micro, µ_bl_ops,
- µ_bl_props);
+ µ_bl_props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd))
return PTR_ERR(bd);
@@ -118,7 +118,8 @@ static int jornada_bl_probe(struct platform_device *pdev)
bd = devm_backlight_device_register(&pdev->dev, S1D_DEVICENAME,
&pdev->dev, NULL, &jornada_bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
ret = PTR_ERR(bd);
dev_err(&pdev->dev, "failed to register device, err=%x\n", ret);
@@ -153,7 +153,8 @@ static int kb3886bl_probe(struct platform_device *pdev)
kb3886_backlight_device = devm_backlight_device_register(&pdev->dev,
"kb3886-bl", &pdev->dev,
NULL, &kb3886bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(kb3886_backlight_device))
return PTR_ERR(kb3886_backlight_device);
@@ -722,7 +722,8 @@ static int ld9040_probe(struct spi_device *spi)
props.max_brightness = MAX_BRIGHTNESS;
bd = devm_backlight_device_register(&spi->dev, "ld9040-bl", &spi->dev,
- lcd, &ld9040_backlight_ops, &props);
+ lcd, &ld9040_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd))
return PTR_ERR(bd);
@@ -312,7 +312,8 @@ static int lm3533_bl_probe(struct platform_device *pdev)
props.brightness = pdata->default_brightness;
bd = devm_backlight_device_register(&pdev->dev, pdata->name,
pdev->dev.parent, bl, &lm3533_bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
dev_err(&pdev->dev, "failed to register backlight device\n");
return PTR_ERR(bd);
@@ -338,7 +338,8 @@ static int lm3630a_backlight_register(struct lm3630a_chip *pchip)
pchip->bleda =
devm_backlight_device_register(pchip->dev, "lm3630a_leda",
pchip->dev, pchip,
- &lm3630a_bank_a_ops, &props);
+ &lm3630a_bank_a_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(pchip->bleda))
return PTR_ERR(pchip->bleda);
}
@@ -350,7 +351,8 @@ static int lm3630a_backlight_register(struct lm3630a_chip *pchip)
pchip->bledb =
devm_backlight_device_register(pchip->dev, "lm3630a_ledb",
pchip->dev, pchip,
- &lm3630a_bank_b_ops, &props);
+ &lm3630a_bank_b_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(pchip->bledb))
return PTR_ERR(pchip->bledb);
}
@@ -349,7 +349,8 @@ static int lm3639_probe(struct i2c_client *client,
pchip->bled =
devm_backlight_device_register(pchip->dev, "lm3639_bled",
pchip->dev, pchip, &lm3639_bled_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(pchip->bled)) {
dev_err(&client->dev, "fail : backlight register\n");
ret = PTR_ERR(pchip->bled);
@@ -200,7 +200,8 @@ static int locomolcd_probe(struct locomo_dev *ldev)
props.max_brightness = 4;
locomolcd_bl_device = backlight_device_register("locomo-bl",
&ldev->dev, NULL,
- &locomobl_data, &props);
+ &locomobl_data, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(locomolcd_bl_device))
return PTR_ERR(locomolcd_bl_device);
@@ -299,7 +299,8 @@ static int lp855x_backlight_register(struct lp855x *lp)
props.brightness = pdata->initial_brightness;
bl = devm_backlight_device_register(lp->dev, name, lp->dev, lp,
- &lp855x_bl_ops, &props);
+ &lp855x_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl))
return PTR_ERR(bl);
@@ -214,7 +214,8 @@ static int lp8788_backlight_register(struct lp8788_bl *bl)
name = pdata->name;
bl_dev = backlight_device_register(name, bl->lp->dev, bl,
- &lp8788_bl_ops, &props);
+ &lp8788_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl_dev))
return PTR_ERR(bl_dev);
@@ -120,7 +120,8 @@ static int lv5207lp_probe(struct i2c_client *client,
backlight = devm_backlight_device_register(&client->dev,
dev_name(&client->dev), &lv->client->dev,
- lv, &lv5207lp_backlight_ops, &props);
+ lv, &lv5207lp_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(backlight)) {
dev_err(&client->dev, "failed to register backlight\n");
return PTR_ERR(backlight);
@@ -165,7 +165,8 @@ static int max8925_backlight_probe(struct platform_device *pdev)
props.max_brightness = MAX_BRIGHTNESS;
bl = devm_backlight_device_register(&pdev->dev, "max8925-backlight",
&pdev->dev, data,
- &max8925_backlight_ops, &props);
+ &max8925_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
return PTR_ERR(bl);
@@ -148,7 +148,8 @@ static int omapbl_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
props.max_brightness = OMAPBL_MAX_INTENSITY;
dev = devm_backlight_device_register(&pdev->dev, "omap-bl", &pdev->dev,
- bl, &omapbl_ops, &props);
+ bl, &omapbl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(dev))
return PTR_ERR(dev);
@@ -120,7 +120,8 @@ static int ot200_backlight_probe(struct platform_device *pdev)
bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev),
&pdev->dev, data, &ot200_backlight_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
retval = PTR_ERR(bl);
@@ -115,7 +115,8 @@ static int pandora_backlight_probe(struct platform_device *pdev)
props.max_brightness = MAX_USER_VALUE;
props.type = BACKLIGHT_RAW;
bl = devm_backlight_device_register(&pdev->dev, pdev->name, &pdev->dev,
- NULL, &pandora_backlight_ops, &props);
+ NULL, &pandora_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
return PTR_ERR(bl);
@@ -129,7 +129,8 @@ static int pcf50633_bl_probe(struct platform_device *pdev)
pcf_bl->bl = devm_backlight_device_register(&pdev->dev, pdev->name,
&pdev->dev, pcf_bl,
- &pcf50633_bl_ops, &bl_props);
+ &pcf50633_bl_ops, &bl_props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(pcf_bl->bl))
return PTR_ERR(pcf_bl->bl);
@@ -408,7 +408,8 @@ static int pm8941_wled_probe(struct platform_device *pdev)
props.max_brightness = PM8941_WLED_REG_VAL_MAX;
bl = devm_backlight_device_register(&pdev->dev, wled->name,
&pdev->dev, wled,
- &pm8941_wled_ops, &props);
+ &pm8941_wled_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
return PTR_ERR_OR_ZERO(bl);
};
@@ -330,7 +330,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
props.max_brightness = data->max_brightness;
bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, pb,
- &pwm_backlight_ops, &props);
+ &pwm_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
ret = PTR_ERR(bl);
@@ -748,7 +748,8 @@ static int s6e63m0_probe(struct spi_device *spi)
bd = devm_backlight_device_register(&spi->dev, "s6e63m0bl-bl",
&spi->dev, lcd, &s6e63m0_backlight_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd))
return PTR_ERR(bd);
@@ -294,7 +294,8 @@ static int sky81452_bl_probe(struct platform_device *pdev)
props.max_brightness = SKY81452_MAX_BRIGHTNESS,
name = pdata->name ? pdata->name : SKY81452_DEFAULT_NAME;
bd = devm_backlight_device_register(dev, name, dev, regmap,
- &sky81452_bl_ops, &props);
+ &sky81452_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
dev_err(dev, "failed to register. err=%ld\n", PTR_ERR(bd));
return PTR_ERR(bd);
@@ -107,7 +107,8 @@ static int tosa_bl_probe(struct i2c_client *client,
props.max_brightness = 512 - 1;
data->bl = devm_backlight_device_register(&client->dev, "tosa-bl",
&client->dev, data, &bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(data->bl)) {
ret = PTR_ERR(data->bl);
goto err_reg;
@@ -306,7 +306,8 @@ static int tps65217_bl_probe(struct platform_device *pdev)
tps65217_bl->bl = devm_backlight_device_register(&pdev->dev, pdev->name,
tps65217_bl->dev, tps65217_bl,
- &tps65217_bl_ops, &bl_props);
+ &tps65217_bl_ops, &bl_props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(tps65217_bl->bl)) {
dev_err(tps65217_bl->dev,
"registration of backlight device failed: %d\n", rc);
@@ -197,7 +197,8 @@ static int wm831x_backlight_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
props.max_brightness = max_isel;
bl = devm_backlight_device_register(&pdev->dev, "wm831x", &pdev->dev,
- data, &wm831x_backlight_ops, &props);
+ data, &wm831x_backlight_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
return PTR_ERR(bl);
@@ -244,7 +244,8 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
props.type = BACKLIGHT_RAW;
props.max_brightness = 0xff;
bl = backlight_device_register("backlight", &sinfo->pdev->dev, sinfo,
- &atmel_lcdc_bl_ops, &props);
+ &atmel_lcdc_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n",
PTR_ERR(bl));
@@ -1871,7 +1871,8 @@ static void aty128_bl_init(struct aty128fb_par *par)
props.type = BACKLIGHT_RAW;
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
bd = backlight_device_register(name, info->dev, par, &aty128_bl_data,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
info->bl_dev = NULL;
printk(KERN_WARNING "aty128: Backlight registration failed\n");
@@ -2242,7 +2242,8 @@ static void aty_bl_init(struct atyfb_par *par)
props.type = BACKLIGHT_RAW;
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
bd = backlight_device_register(name, info->dev, par, &aty_bl_data,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
info->bl_dev = NULL;
printk(KERN_WARNING "aty: Backlight registration failed\n");
@@ -155,7 +155,8 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
props.type = BACKLIGHT_RAW;
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
bd = backlight_device_register(name, rinfo->info->dev, pdata,
- &radeon_bl_data, &props);
+ &radeon_bl_data, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
rinfo->info->bl_dev = NULL;
printk("radeonfb: Backlight registration failed\n");
@@ -765,7 +765,8 @@ static int bfin_lq035_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
props.max_brightness = MAX_BRIGHENESS;
bl_dev = backlight_device_register("bf537-bl", NULL, NULL,
- &bfin_lq035fb_bl_ops, &props);
+ &bfin_lq035fb_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
lcd_dev = lcd_device_register(KBUILD_MODNAME, &pdev->dev, NULL,
&bfin_lcd_ops);
@@ -652,7 +652,8 @@ static int bfin_bf54x_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
props.max_brightness = 255;
bl_dev = backlight_device_register("bf54x-bl", NULL, NULL,
- &bfin_lq043fb_bl_ops, &props);
+ &bfin_lq043fb_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl_dev)) {
printk(KERN_ERR DRIVER_NAME
": unable to register backlight.\n");
@@ -549,7 +549,8 @@ static int bfin_t350mcqb_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
props.max_brightness = 255;
bl_dev = backlight_device_register("bf52x-bl", NULL, NULL,
- &bfin_lq043fb_bl_ops, &props);
+ &bfin_lq043fb_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl_dev)) {
printk(KERN_ERR DRIVER_NAME
": unable to register backlight.\n");
@@ -796,7 +796,8 @@ static int s6e8ax0_probe(struct mipi_dsim_lcd_device *dsim_dev)
}
lcd->bd = devm_backlight_device_register(lcd->dev, "s6e8ax0-bl",
- lcd->dev, lcd, &s6e8ax0_backlight_ops, NULL);
+ lcd->dev, lcd, &s6e8ax0_backlight_ops, NULL,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(lcd->bd)) {
dev_err(lcd->dev, "failed to register backlight ops.\n");
return PTR_ERR(lcd->bd);
@@ -319,7 +319,8 @@ static void mx3fb_init_backlight(struct mx3fb_data *fbd)
sdc_set_brightness(fbd, fbd->backlight_level);
bl = backlight_device_register("mx3fb-bl", fbd->dev, fbd,
- &mx3fb_lcdc_bl_ops, &props);
+ &mx3fb_lcdc_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(fbd->dev, "error %ld on backlight register\n",
PTR_ERR(bl));
@@ -108,7 +108,8 @@ void nvidia_bl_init(struct nvidia_par *par)
props.type = BACKLIGHT_RAW;
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
bd = backlight_device_register(name, info->dev, par, &nvidia_bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
info->bl_dev = NULL;
printk(KERN_WARNING "nvidia: Backlight registration failed\n");
@@ -1259,7 +1259,8 @@ static int dsicm_probe(struct platform_device *pdev)
props.type = BACKLIGHT_RAW;
bldev = backlight_device_register(dev_name(dev),
- dev, ddata, &dsicm_bl_ops, &props);
+ dev, ddata, &dsicm_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bldev)) {
r = PTR_ERR(bldev);
goto err_bl;
@@ -816,7 +816,8 @@ static int acx565akm_probe(struct spi_device *spi)
props.type = BACKLIGHT_RAW;
bldev = backlight_device_register("acx565akm", &ddata->spi->dev,
- ddata, &acx565akm_bl_ops, &props);
+ ddata, &acx565akm_bl_ops, &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bldev)) {
r = PTR_ERR(bldev);
goto err_reg_bl;
@@ -343,7 +343,8 @@ static void riva_bl_init(struct riva_par *par)
props.type = BACKLIGHT_RAW;
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
bd = backlight_device_register(name, info->dev, par, &riva_bl_ops,
- &props);
+ &props,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bd)) {
info->bl_dev = NULL;
printk(KERN_WARNING "riva: Backlight registration failed\n");
@@ -2314,7 +2314,8 @@ static struct backlight_device *sh_mobile_lcdc_bl_probe(struct device *parent,
struct backlight_device *bl;
bl = backlight_device_register(ch->cfg->bl_info.name, parent, ch,
- &sh_mobile_lcdc_bl_ops, NULL);
+ &sh_mobile_lcdc_bl_ops, NULL,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
dev_err(parent, "unable to register backlight device: %ld\n",
PTR_ERR(bl));
@@ -673,7 +673,8 @@ static int ssd1307fb_probe(struct i2c_client *client,
snprintf(bl_name, sizeof(bl_name), "ssd1307fb%d", info->node);
bl = backlight_device_register(bl_name, &client->dev, par,
- &ssd1307fb_bl_ops, NULL);
+ &ssd1307fb_bl_ops, NULL,
+ BACKLIGHT_REGISTER_FB_CLIENT);
if (IS_ERR(bl)) {
ret = PTR_ERR(bl);
dev_err(&client->dev, "unable to register backlight device: %d\n",
@@ -129,13 +129,16 @@ static inline int backlight_update_status(struct backlight_device *bd)
return ret;
}
+#define BACKLIGHT_REGISTER_FB_CLIENT 0x1
extern struct backlight_device *backlight_device_register(const char *name,
struct device *dev, void *devdata, const struct backlight_ops *ops,
- const struct backlight_properties *props);
+ const struct backlight_properties *props,
+ unsigned long flags);
extern struct backlight_device *devm_backlight_device_register(
struct device *dev, const char *name, struct device *parent,
void *devdata, const struct backlight_ops *ops,
- const struct backlight_properties *props);
+ const struct backlight_properties *props,
+ unsigned long flags);
extern void backlight_device_unregister(struct backlight_device *bd);
extern void devm_backlight_device_unregister(struct device *dev,
struct backlight_device *bd);