Skip to content

Commit 675285a

Browse files
committed
Merge tag 'fbdev-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev
Pull fbdev updates from Helge Deller: "Some fbdev fixes & cleanups. Includes is a fix for a potential out-of-bound memory access in fast_imageblit() and the switch of the VIA fbdev driver to use GPIO descriptors. Summary: - fix potential OOB read in fast_imageblit() - fbdev/media: Use GPIO descriptors for VIA GPIO - broadsheetfb & metronomefb: Add MODULE_FIRMWARE macro - omapfb: error handling fix in mipid_spi_probe() - sh_mobile_lcdcfb, sh7760fb: Typo and warning fixes - hitfb: code cleanups" * tag 'fbdev-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: fix potential OOB read in fast_imageblit() MAINTAINERS: adjust entry in VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER fbdev: sh7760fb: Fix -Wimplicit-fallthrough warnings fbdev: sh_mobile_lcdcfb: Fix ARGB32 overlay format typo fbdev: hitfb: Use NULL for pointers fbdev: hitfb: Fix integer-to-pointer cast fbdev/media: Use GPIO descriptors for VIA GPIO video/hdmi: Reorder fields in 'struct hdmi_avi_infoframe' fbdev: broadsheetfb: Add MODULE_FIRMWARE macro fbdev: metronomefb: Add MODULE_FIRMWARE macro fbdev: hitfb: Declare hitfb_blank() as static fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe()
2 parents e5476f5 + c2d2280 commit 675285a

File tree

13 files changed

+54
-57
lines changed

13 files changed

+54
-57
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22277,7 +22277,6 @@ L: [email protected]
2227722277
S: Maintained
2227822278
F: drivers/video/fbdev/via/
2227922279
F: include/linux/via-core.h
22280-
F: include/linux/via-gpio.h
2228122280
F: include/linux/via_i2c.h
2228222281

2228322282
VIA VELOCITY NETWORK DRIVER

drivers/media/platform/via/via-camera.c

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/device.h>
1212
#include <linux/list.h>
1313
#include <linux/pci.h>
14-
#include <linux/gpio.h>
14+
#include <linux/gpio/consumer.h>
1515
#include <linux/interrupt.h>
1616
#include <linux/platform_device.h>
1717
#include <linux/videodev2.h>
@@ -26,7 +26,6 @@
2626
#include <linux/dma-mapping.h>
2727
#include <linux/pm_qos.h>
2828
#include <linux/via-core.h>
29-
#include <linux/via-gpio.h>
3029
#include <linux/via_i2c.h>
3130

3231
#ifdef CONFIG_X86
@@ -71,8 +70,8 @@ struct via_camera {
7170
/*
7271
* GPIO info for power/reset management
7372
*/
74-
int power_gpio;
75-
int reset_gpio;
73+
struct gpio_desc *power_gpio;
74+
struct gpio_desc *reset_gpio;
7675
/*
7776
* I/O memory stuff.
7877
*/
@@ -180,27 +179,19 @@ static struct via_format *via_find_format(u32 pixelformat)
180179
*/
181180
static int via_sensor_power_setup(struct via_camera *cam)
182181
{
183-
int ret;
182+
struct device *dev = &cam->platdev->dev;
183+
184+
cam->power_gpio = devm_gpiod_get(dev, "VGPIO3", GPIOD_OUT_LOW);
185+
if (IS_ERR(cam->power_gpio))
186+
return dev_err_probe(dev, PTR_ERR(cam->power_gpio),
187+
"failed to get power GPIO");
188+
189+
/* Request the reset line asserted */
190+
cam->reset_gpio = devm_gpiod_get(dev, "VGPIO2", GPIOD_OUT_HIGH);
191+
if (IS_ERR(cam->reset_gpio))
192+
return dev_err_probe(dev, PTR_ERR(cam->reset_gpio),
193+
"failed to get reset GPIO");
184194

185-
cam->power_gpio = viafb_gpio_lookup("VGPIO3");
186-
cam->reset_gpio = viafb_gpio_lookup("VGPIO2");
187-
if (!gpio_is_valid(cam->power_gpio) || !gpio_is_valid(cam->reset_gpio)) {
188-
dev_err(&cam->platdev->dev, "Unable to find GPIO lines\n");
189-
return -EINVAL;
190-
}
191-
ret = gpio_request(cam->power_gpio, "viafb-camera");
192-
if (ret) {
193-
dev_err(&cam->platdev->dev, "Unable to request power GPIO\n");
194-
return ret;
195-
}
196-
ret = gpio_request(cam->reset_gpio, "viafb-camera");
197-
if (ret) {
198-
dev_err(&cam->platdev->dev, "Unable to request reset GPIO\n");
199-
gpio_free(cam->power_gpio);
200-
return ret;
201-
}
202-
gpio_direction_output(cam->power_gpio, 0);
203-
gpio_direction_output(cam->reset_gpio, 0);
204195
return 0;
205196
}
206197

@@ -209,25 +200,23 @@ static int via_sensor_power_setup(struct via_camera *cam)
209200
*/
210201
static void via_sensor_power_up(struct via_camera *cam)
211202
{
212-
gpio_set_value(cam->power_gpio, 1);
213-
gpio_set_value(cam->reset_gpio, 0);
203+
gpiod_set_value(cam->power_gpio, 1);
204+
gpiod_set_value(cam->reset_gpio, 1);
214205
msleep(20); /* Probably excessive */
215-
gpio_set_value(cam->reset_gpio, 1);
206+
gpiod_set_value(cam->reset_gpio, 0);
216207
msleep(20);
217208
}
218209

219210
static void via_sensor_power_down(struct via_camera *cam)
220211
{
221-
gpio_set_value(cam->power_gpio, 0);
222-
gpio_set_value(cam->reset_gpio, 0);
212+
gpiod_set_value(cam->power_gpio, 0);
213+
gpiod_set_value(cam->reset_gpio, 1);
223214
}
224215

225216

226217
static void via_sensor_power_release(struct via_camera *cam)
227218
{
228219
via_sensor_power_down(cam);
229-
gpio_free(cam->power_gpio);
230-
gpio_free(cam->reset_gpio);
231220
}
232221

233222
/* --------------------------------------------------------------------------*/

drivers/video/fbdev/broadsheetfb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,3 +1223,5 @@ module_platform_driver(broadsheetfb_driver);
12231223
MODULE_DESCRIPTION("fbdev driver for Broadsheet controller");
12241224
MODULE_AUTHOR("Jaya Kumar");
12251225
MODULE_LICENSE("GPL");
1226+
1227+
MODULE_FIRMWARE("broadsheet.wbf");

drivers/video/fbdev/core/sysimgblt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static void fast_imageblit(const struct fb_image *image, struct fb_info *p,
189189
u32 fgx = fgcolor, bgx = bgcolor, bpp = p->var.bits_per_pixel;
190190
u32 ppw = 32/bpp, spitch = (image->width + 7)/8;
191191
u32 bit_mask, eorx, shift;
192-
const char *s = image->data, *src;
192+
const u8 *s = image->data, *src;
193193
u32 *dst;
194194
const u32 *tab;
195195
size_t tablen;

drivers/video/fbdev/hitfb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static int hitfb_pan_display(struct fb_var_screeninfo *var,
167167
return 0;
168168
}
169169

170-
int hitfb_blank(int blank_mode, struct fb_info *info)
170+
static int hitfb_blank(int blank_mode, struct fb_info *info)
171171
{
172172
unsigned short v;
173173

@@ -392,7 +392,7 @@ static int hitfb_probe(struct platform_device *dev)
392392
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN |
393393
FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA;
394394

395-
info->screen_base = (void *)hitfb_fix.smem_start;
395+
info->screen_base = (char __iomem *)(uintptr_t)hitfb_fix.smem_start;
396396

397397
ret = fb_alloc_cmap(&info->cmap, 256, 0);
398398
if (unlikely(ret < 0))
@@ -428,7 +428,7 @@ static int hitfb_suspend(struct device *dev)
428428
{
429429
u16 v;
430430

431-
hitfb_blank(1,0);
431+
hitfb_blank(1, NULL);
432432
v = fb_readw(HD64461_STBCR);
433433
v |= HD64461_STBCR_SLCKE_IST;
434434
fb_writew(v, HD64461_STBCR);
@@ -446,7 +446,7 @@ static int hitfb_resume(struct device *dev)
446446
v = fb_readw(HD64461_STBCR);
447447
v &= ~HD64461_STBCR_SLCKE_IST;
448448
fb_writew(v, HD64461_STBCR);
449-
hitfb_blank(0,0);
449+
hitfb_blank(0, NULL);
450450

451451
return 0;
452452
}

drivers/video/fbdev/metronomefb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,3 +778,5 @@ MODULE_PARM_DESC(user_wfm_size, "Set custom waveform size");
778778
MODULE_DESCRIPTION("fbdev driver for Metronome controller");
779779
MODULE_AUTHOR("Jaya Kumar");
780780
MODULE_LICENSE("GPL");
781+
782+
MODULE_FIRMWARE("metronome.wbf");

drivers/video/fbdev/omap/lcd_mipid.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,15 @@ static int mipid_spi_probe(struct spi_device *spi)
571571

572572
r = mipid_detect(md);
573573
if (r < 0)
574-
return r;
574+
goto free_md;
575575

576576
omapfb_register_panel(&md->panel);
577577

578578
return 0;
579+
580+
free_md:
581+
kfree(md);
582+
return r;
579583
}
580584

581585
static void mipid_spi_remove(struct spi_device *spi)

drivers/video/fbdev/sh7760fb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,13 @@ static int sh7760fb_get_color_info(struct device *dev,
136136
break;
137137
case LDDFR_4BPP_MONO:
138138
lgray = 1;
139+
fallthrough;
139140
case LDDFR_4BPP:
140141
lbpp = 4;
141142
break;
142143
case LDDFR_6BPP_MONO:
143144
lgray = 1;
145+
fallthrough;
144146
case LDDFR_8BPP:
145147
lbpp = 8;
146148
break;

drivers/video/fbdev/sh_mobile_lcdcfb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ static void sh_mobile_lcdc_overlay_setup(struct sh_mobile_lcdc_overlay *ovl)
824824
format |= LDBBSIFR_AL_1 | LDBBSIFR_RY | LDBBSIFR_RPKF_RGB24;
825825
break;
826826
case V4L2_PIX_FMT_BGR32:
827-
format |= LDBBSIFR_AL_PK | LDBBSIFR_RY | LDDFR_PKF_ARGB32;
827+
format |= LDBBSIFR_AL_PK | LDBBSIFR_RY | LDBBSIFR_RPKF_ARGB32;
828828
break;
829829
case V4L2_PIX_FMT_NV12:
830830
case V4L2_PIX_FMT_NV21:

drivers/video/fbdev/via/via-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/aperture.h>
1212
#include <linux/via-core.h>
1313
#include <linux/via_i2c.h>
14-
#include <linux/via-gpio.h>
14+
#include "via-gpio.h"
1515
#include "global.h"
1616

1717
#include <linux/module.h>

0 commit comments

Comments
 (0)