search for: led_full

Displaying 12 results from an estimated 12 matches for "led_full".

2016 Sep 16
2
[PATCH 2/3] drm/nouveau/led: guard against a division by 0
...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; minor nitpick: you can drop the else, I don't mind though. Maybe it would be clearer to do it the other way around though. Or to do: if (unlikely(div <=...
2016 Sep 16
7
[PATCH 1/3] drm/nouveau/led: don't access led subdev if it wasn't initialized
From: Karol Herbst <karolherbst at gmail.com> Fixes a kernel crash on suspend/resume. --- drm/nouveau/nouveau_led.c | 7 ++++--- 1 file changed, 4 insertions(+), 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
2016 Sep 16
0
[PATCH 2/3] drm/nouveau/led: guard against a division by 0
...> +++ 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; > minor nitpick: you can drop the else, I don't mind though. Maybe it > would be clearer to do it the other way around though. > >...
2016 Sep 16
0
[PATCH 2/3] drm/nouveau/led: guard against a division by 0
...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 Aug 22
10
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...r_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(device, 0x61c884) & 0x00ffffff; + + return duty * LED_FULL / div; +} + +static void +nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value) +{ + 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...
2016 Aug 23
1
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...>> + struct nvif_object *device = &drm->device.object; >> + u32 div, duty; >> + >> + div = nvif_rd32(device, 0x61c880) & 0x00ffffff; >> + duty = nvif_rd32(device, 0x61c884) & 0x00ffffff; >> + >> + return duty * LED_FULL / div; >> +} >> + >> +static void >> +nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value) >> +{ >> + struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; >> + struct nouveau_drm *drm = nouv...
2016 Aug 22
0
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...r_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(device, 0x61c884) & 0x00ffffff; + + return duty * LED_FULL / div; +} + +static void +nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value) +{ + 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...
2016 May 03
0
[PATCH] drm/nouveau: add a LED driver for the NVIDIA logo
...*drm = nouveau_drm(drm_dev); > + struct nvif_object *device = &drm->device.object; > + u32 div, duty; > + > + div = nvif_rd32(device, 0x61c880) & 0x00ffffff; > + duty = nvif_rd32(device, 0x61c884) & 0x00ffffff; > + > + return duty * LED_FULL / div; > +} > + > +static void > +nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value) > +{ > + struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; > + struct nouveau_drm *drm = nouveau_drm(drm_dev); > +...
2016 Aug 23
0
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...*drm = nouveau_drm(drm_dev); > + struct nvif_object *device = &drm->device.object; > + u32 div, duty; > + > + div = nvif_rd32(device, 0x61c880) & 0x00ffffff; > + duty = nvif_rd32(device, 0x61c884) & 0x00ffffff; > + > + return duty * LED_FULL / div; > +} > + > +static void > +nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value) > +{ > + struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; > + struct nouveau_drm *drm = nouveau_drm(drm_dev); > +...
2016 May 07
0
[PATCH] drm/nouveau: add a LED driver for the NVIDIA logo
...*drm = nouveau_drm(drm_dev); > + struct nvif_object *device = &drm->device.object; > + u32 div, duty; > + > + div = nvif_rd32(device, 0x61c880) & 0x00ffffff; > + duty = nvif_rd32(device, 0x61c884) & 0x00ffffff; > + > + return duty * LED_FULL / div; > +} > + > +static void > +nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value) > +{ > + struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; > + struct nouveau_drm *drm = nouveau_drm(drm_dev); > +...
2007 Apr 18
5
[patch 0/4] Revised softlockup watchdog improvement patches
Hi Ingo, This series of patches implements a number of improvements to the softlockup watchdog and its users. They are: 1. Make the watchdog ignore stolen time When running under a hypervisor, the kernel may lose an arbitrary amount of time as "stolen time". This may cause the softlockup watchdog to trigger spruiously. Xen and VMI implement sched_clock() as measuring unstolen time,
2007 Apr 18
5
[patch 0/4] Revised softlockup watchdog improvement patches
Hi Ingo, This series of patches implements a number of improvements to the softlockup watchdog and its users. They are: 1. Make the watchdog ignore stolen time When running under a hypervisor, the kernel may lose an arbitrary amount of time as "stolen time". This may cause the softlockup watchdog to trigger spruiously. Xen and VMI implement sched_clock() as measuring unstolen time,