search for: nouveau_led_get_bright

Displaying 10 results from an estimated 10 matches for "nouveau_led_get_bright".

2016 Sep 16
2
[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; > +...
2016 Aug 22
10
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...HE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/* + * 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;...
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 Aug 22
0
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...TWARE OR THE USE OR OTHER DEALINGS 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;...
2016 May 03
0
[PATCH] drm/nouveau: add a LED driver for the NVIDIA logo
...; + * 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; > + &...
2016 Aug 23
0
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...; + * 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; > + &...
2016 May 07
0
[PATCH] drm/nouveau: add a LED driver for the NVIDIA logo
...; + * 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; > + &...
2016 Sep 16
0
[PATCH 2/3] drm/nouveau/led: guard against a division by 0
...t;martin.peres at free.fr> --- 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
...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 *...
2016 Aug 23
1
[PATCH v2] drm/nouveau: add a LED driver for the NVIDIA logo
...t;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...