18d021d71SMartin Peres /*
28d021d71SMartin Peres  * Copyright 2015 Martin Peres
38d021d71SMartin Peres  *
48d021d71SMartin Peres  * Permission is hereby granted, free of charge, to any person obtaining a
58d021d71SMartin Peres  * copy of this software and associated documentation files (the "Software"),
68d021d71SMartin Peres  * to deal in the Software without restriction, including without limitation
78d021d71SMartin Peres  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
88d021d71SMartin Peres  * and/or sell copies of the Software, and to permit persons to whom the
98d021d71SMartin Peres  * Software is furnished to do so, subject to the following conditions:
108d021d71SMartin Peres  *
118d021d71SMartin Peres  * The above copyright notice and this permission notice shall be included in
128d021d71SMartin Peres  * all copies or substantial portions of the Software.
138d021d71SMartin Peres  *
148d021d71SMartin Peres  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158d021d71SMartin Peres  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
168d021d71SMartin Peres  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
178d021d71SMartin Peres  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
188d021d71SMartin Peres  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
198d021d71SMartin Peres  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
208d021d71SMartin Peres  * OTHER DEALINGS IN THE SOFTWARE.
218d021d71SMartin Peres  *
228d021d71SMartin Peres  * Authors: Martin Peres <martin.peres@free.fr>
238d021d71SMartin Peres  */
248d021d71SMartin Peres 
258d021d71SMartin Peres #ifndef __NOUVEAU_LED_H__
268d021d71SMartin Peres #define __NOUVEAU_LED_H__
278d021d71SMartin Peres 
288d021d71SMartin Peres #include "nouveau_drv.h"
298d021d71SMartin Peres 
30*f56e0071SThomas Weißschuh #include <linux/leds.h>
318d021d71SMartin Peres 
328d021d71SMartin Peres struct nouveau_led {
338d021d71SMartin Peres 	struct drm_device *dev;
348d021d71SMartin Peres 
358d021d71SMartin Peres 	struct led_classdev led;
368d021d71SMartin Peres };
378d021d71SMartin Peres 
388d021d71SMartin Peres static inline struct nouveau_led *
nouveau_led(struct drm_device * dev)398d021d71SMartin Peres nouveau_led(struct drm_device *dev)
408d021d71SMartin Peres {
418d021d71SMartin Peres 	return nouveau_drm(dev)->led;
428d021d71SMartin Peres }
438d021d71SMartin Peres 
448d021d71SMartin Peres /* nouveau_led.c */
45d72498caSMartin Peres #if IS_REACHABLE(CONFIG_LEDS_CLASS)
468d021d71SMartin Peres int  nouveau_led_init(struct drm_device *dev);
478d021d71SMartin Peres void nouveau_led_suspend(struct drm_device *dev);
488d021d71SMartin Peres void nouveau_led_resume(struct drm_device *dev);
498d021d71SMartin Peres void nouveau_led_fini(struct drm_device *dev);
508d021d71SMartin Peres #else
nouveau_led_init(struct drm_device * dev)518d021d71SMartin Peres static inline int  nouveau_led_init(struct drm_device *dev) { return 0; };
nouveau_led_suspend(struct drm_device * dev)528d021d71SMartin Peres static inline void nouveau_led_suspend(struct drm_device *dev) { };
nouveau_led_resume(struct drm_device * dev)538d021d71SMartin Peres static inline void nouveau_led_resume(struct drm_device *dev) { };
nouveau_led_fini(struct drm_device * dev)548d021d71SMartin Peres static inline void nouveau_led_fini(struct drm_device *dev) { };
558d021d71SMartin Peres #endif
568d021d71SMartin Peres 
578d021d71SMartin Peres #endif
58