search for: led_classdev

Displaying 13 results from an estimated 13 matches for "led_classdev".

2016 Aug 22
10
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...FTWARE. + * + */ + +/* + * Authors: + * Martin Peres <martin.peres at free.fr> + */ + +#include <linux/leds.h> + +#include "nouveau_drm.h" +#include "nouveau_led.h" +#include <nvkm/subdev/gpio.h> + +static enum led_brightness +nouveau_led_get_brightness(struct led_classdev *led) +{ + struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; + struct nouveau_drm *drm = nouveau_drm(drm_dev); + struct nvif_object *device = &drm->device.object; + u32 div, duty; + + div = nvif_rd32(device, 0x61c880) & 0x00ffffff; + duty = nvif_rd32(devic...
2016 Sep 16
2
[PATCH 2/3] drm/nouveau/led: guard against a division by 0
...+- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drm/nouveau/nouveau_led.c b/drm/nouveau/nouveau_led.c > index 5e28b5f..1f731da 100644 > --- a/drm/nouveau/nouveau_led.c > +++ b/drm/nouveau/nouveau_led.c > @@ -44,7 +44,10 @@ nouveau_led_get_brightness(struct led_classdev *led) > div = nvif_rd32(device, 0x61c880) & 0x00ffffff; > duty = nvif_rd32(device, 0x61c884) & 0x00ffffff; > > - return duty * LED_FULL / div; > + if (div > 0) > + return duty * LED_FULL / div; > + else > +...
2016 Aug 22
0
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...IN THE SOFTWARE. + * + */ + +/* + * Authors: + * Martin Peres <martin.peres at free.fr> + */ + +#include <linux/leds.h> + +#include "nouveau_led.h" +#include <nvkm/subdev/gpio.h> + +#ifdef CONFIG_LEDS_CLASS +static enum led_brightness +nouveau_led_get_brightness(struct led_classdev *led) +{ + struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; + struct nouveau_drm *drm = nouveau_drm(drm_dev); + struct nvif_object *device = &drm->device.object; + u32 div, duty; + + div = nvif_rd32(device, 0x61c880) & 0x00ffffff; + duty = nvif_rd32(devic...
2016 May 03
0
[PATCH] drm/nouveau: add a LED driver for the NVIDIA logo
...res <martin.peres at free.fr> > + */ > + > +#include <linux/leds.h> > + > +#include "nouveau_drm.h" > +#include "nouveau_led.h" > +#include <nvkm/subdev/gpio.h> > + > +static enum led_brightness > +nouveau_led_get_brightness(struct led_classdev *led) > +{ > + struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; > + struct nouveau_drm *drm = nouveau_drm(drm_dev); > + struct nvif_object *device = &drm->device.object; > + u32 div, duty; > + > + div = nvif_...
2016 Aug 23
0
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...res <martin.peres at free.fr> > + */ > + > +#include <linux/leds.h> > + > +#include "nouveau_drm.h" > +#include "nouveau_led.h" > +#include <nvkm/subdev/gpio.h> > + > +static enum led_brightness > +nouveau_led_get_brightness(struct led_classdev *led) > +{ > + struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; > + struct nouveau_drm *drm = nouveau_drm(drm_dev); > + struct nvif_object *device = &drm->device.object; > + u32 div, duty; > + > + div = nvif_...
2016 May 07
0
[PATCH] drm/nouveau: add a LED driver for the NVIDIA logo
looks good, just a minor thing: You need to check for CONFIG_LEDS_CLASS, otherwise the compile throws out "warnings": WARNING: "led_classdev_register" [/home/karol/Dokumente/repos/nouveau/drm/nouveau/nouveau.ko] undefined! WARNING: "led_classdev_resume" [/home/karol/Dokumente/repos/nouveau/drm/nouveau/nouveau.ko] undefined! WARNING: "led_classdev_unregister" [/home/karol/Dokumente/repos/nouveau/drm/nouveau/nouve...
2016 Nov 08
2
[PATCH] drm/nouveau: fix LEDS_CLASS=m configuration
...'s what I was suggesting: diff --git a/drivers/gpu/drm/nouveau/nouveau_led.h b/drivers/gpu/drm/nouveau/nouveau_led.h index 9c9bb6ac938e..bc5f47cb516b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_led.h +++ b/drivers/gpu/drm/nouveau/nouveau_led.h @@ -35,21 +35,21 @@ struct nouveau_led { struct led_classdev led; }; static inline struct nouveau_led * nouveau_led(struct drm_device *dev) { return nouveau_drm(dev)->led; } /* nouveau_led.c */ -#if IS_ENABLED(CONFIG_LEDS_CLASS) +#if IS_REACHABLE(CONFIG_LEDS_CLASS) int nouveau_led_init(struct drm_device *dev); void nouveau_led_suspend(struc...
2016 Aug 23
1
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...> + */ >> + >> +#include <linux/leds.h> >> + >> +#include "nouveau_drm.h" >> +#include "nouveau_led.h" >> +#include <nvkm/subdev/gpio.h> >> + >> +static enum led_brightness >> +nouveau_led_get_brightness(struct led_classdev *led) >> +{ >> + struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; >> + struct nouveau_drm *drm = nouveau_drm(drm_dev); >> + struct nvif_object *device = &drm->device.object; >> + u32 div, duty; >> + &...
2016 Sep 16
7
[PATCH 1/3] drm/nouveau/led: don't access led subdev if it wasn't initialized
...s(+), 3 deletions(-) diff --git a/drm/nouveau/nouveau_led.c b/drm/nouveau/nouveau_led.c index 9eed5a6..5e28b5f 100644 --- a/drm/nouveau/nouveau_led.c +++ b/drm/nouveau/nouveau_led.c @@ -107,7 +107,8 @@ nouveau_led_suspend(struct drm_device *dev) { struct nouveau_drm *drm = nouveau_drm(dev); - led_classdev_suspend(&drm->led->led); + if (drm->led) + led_classdev_suspend(&drm->led->led); } void @@ -115,8 +116,8 @@ nouveau_led_resume(struct drm_device *dev) { struct nouveau_drm *drm = nouveau_drm(dev); - led_classdev_resume(&drm->led->led); - + if (drm->led)...
2016 Sep 16
0
[PATCH 2/3] drm/nouveau/led: guard against a division by 0
...drm/nouveau/nouveau_led.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drm/nouveau/nouveau_led.c b/drm/nouveau/nouveau_led.c index 5e28b5f..1f731da 100644 --- a/drm/nouveau/nouveau_led.c +++ b/drm/nouveau/nouveau_led.c @@ -44,7 +44,10 @@ nouveau_led_get_brightness(struct led_classdev *led) div = nvif_rd32(device, 0x61c880) & 0x00ffffff; duty = nvif_rd32(device, 0x61c884) & 0x00ffffff; - return duty * LED_FULL / div; + if (div > 0) + return duty * LED_FULL / div; + else + return 0; } static void -- 2.8.0
2016 Sep 16
0
[PATCH 2/3] drm/nouveau/led: guard against a division by 0
...4 insertions(+), 1 deletion(-) >> >> diff --git a/drm/nouveau/nouveau_led.c b/drm/nouveau/nouveau_led.c >> index 5e28b5f..1f731da 100644 >> --- a/drm/nouveau/nouveau_led.c >> +++ b/drm/nouveau/nouveau_led.c >> @@ -44,7 +44,10 @@ nouveau_led_get_brightness(struct led_classdev *led) >> div = nvif_rd32(device, 0x61c880) & 0x00ffffff; >> duty = nvif_rd32(device, 0x61c884) & 0x00ffffff; >> >> - return duty * LED_FULL / div; >> + if (div > 0) >> + return duty * LED_FULL / div; >&gt...
2016 Nov 08
0
[PATCH] drm/nouveau: fix LEDS_CLASS=m configuration
...diff --git a/drivers/gpu/drm/nouveau/nouveau_led.h b/drivers/gpu/drm/nouveau/nouveau_led.h > index 9c9bb6ac938e..bc5f47cb516b 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_led.h > +++ b/drivers/gpu/drm/nouveau/nouveau_led.h > @@ -35,21 +35,21 @@ struct nouveau_led { > struct led_classdev led; > }; > > static inline struct nouveau_led * > nouveau_led(struct drm_device *dev) > { > return nouveau_drm(dev)->led; > } > > /* nouveau_led.c */ > -#if IS_ENABLED(CONFIG_LEDS_CLASS) > +#if IS_REACHABLE(CONFIG_LEDS_CLASS) > int nouveau_led...
2016 Nov 08
2
[PATCH] drm/nouveau: fix LEDS_CLASS=m configuration
On Tuesday, November 8, 2016 10:46:07 AM CET Ilia Mirkin wrote: > > diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig > > index 78631fb61adf..715cd6f4dc31 100644 > > --- a/drivers/gpu/drm/nouveau/Kconfig > > +++ b/drivers/gpu/drm/nouveau/Kconfig > > @@ -46,6 +46,14 @@ config NOUVEAU_DEBUG > > The paranoia and spam levels