/* * Copyright (C) 2009 Red Hat <[email protected]> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /* * Authors: * Matthew Garrett <[email protected]> * * Register locations derived from NVClock by Roderick Colenbrander */ #include <linux/apple-gmux.h> #include <linux/backlight.h> #include <linux/idr.h> #include <drm/drm_probe_helper.h> #include "nouveau_drv.h" #include "nouveau_reg.h" #include "nouveau_encoder.h" #include "nouveau_connector.h" #include "nouveau_acpi.h" static struct ida bl_ida; #define BL_NAME_SIZE … static bool nouveau_get_backlight_name(char backlight_name[BL_NAME_SIZE], struct nouveau_backlight *bl) { … } static int nv40_get_intensity(struct backlight_device *bd) { … } static int nv40_set_intensity(struct backlight_device *bd) { … } static const struct backlight_ops nv40_bl_ops = …; static int nv40_backlight_init(struct nouveau_encoder *encoder, struct backlight_properties *props, const struct backlight_ops **ops) { … } /* * eDP brightness callbacks need to happen under lock, since we need to * enable/disable the backlight ourselves for modesets */ static int nv50_edp_get_brightness(struct backlight_device *bd) { … } static int nv50_edp_set_brightness(struct backlight_device *bd) { … } static const struct backlight_ops nv50_edp_bl_ops = …; static int nv50_get_intensity(struct backlight_device *bd) { … } static int nv50_set_intensity(struct backlight_device *bd) { … } static const struct backlight_ops nv50_bl_ops = …; /* FIXME: perform backlight probing for eDP _before_ this, this only gets called after connector * registration which happens after the initial modeset */ static int nv50_backlight_init(struct nouveau_backlight *bl, struct nouveau_connector *nv_conn, struct nouveau_encoder *nv_encoder, struct backlight_properties *props, const struct backlight_ops **ops) { … } int nouveau_backlight_init(struct drm_connector *connector) { … } void nouveau_backlight_fini(struct drm_connector *connector) { … } void nouveau_backlight_ctor(void) { … } void nouveau_backlight_dtor(void) { … }