Skip to content

Commit 9fa4abc

Browse files
committed
Merge tag 'fbdev-for-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev
Pull fbdev updates from Helge Deller: "The most relevant change are the patches from Dmitry Torokhov to switch omapfb to the gpiod API. The other patches are small and fix e.g. UML build issues, improve the error paths and cleanup code" * tag 'fbdev-for-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (32 commits) fbdev: fbcon: release buffer when fbcon_do_set_font() failed fbdev: sh_mobile_lcdcfb: use sysfs_emit() to instead of scnprintf() fbdev: uvesafb: use sysfs_emit() to instead of scnprintf() fbdev: uvesafb: Simplify uvesafb_remove() fbdev: uvesafb: Fixes an error handling path in uvesafb_probe() fbdev: uvesafb: don't build on UML fbdev: geode: don't build on UML fbdev: ep93xx-fb: Add missing clk_disable_unprepare in ep93xxfb_probe() fbdev: matroxfb: Convert to i2c's .probe_new() fbdev: da8xx-fb: add missing regulator_disable() in fb_probe fbdev: controlfb: fix spelling mistake "paramaters"->"parameters" fbdev: vermilion: decrease reference count in error path fbdev: smscufx: fix error handling code in ufx_usb_probe fbdev: via: Fix error in via_core_init() fbdev: pm2fb: fix missing pci_disable_device() fbdev: pxafb: Remove unnecessary print function dev_err() fbdev: omapfb: panel-sharp-ls037v7dw01: fix included headers fbdev: omapfb: panel-tpo-td028ttec1: stop including gpio.h fbdev: omapfb: panel-lgphilips-lb035q02: remove backlight GPIO handling fbdev: omapfb: encoder-opa362: fix included headers ...
2 parents 504a73d + 3c3bfb8 commit 9fa4abc

29 files changed

+261
-604
lines changed

drivers/video/fbdev/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ config FB_TGA
609609
config FB_UVESA
610610
tristate "Userspace VESA VGA graphics support"
611611
depends on FB && CONNECTOR
612+
depends on !UML
612613
select FB_CFB_FILLRECT
613614
select FB_CFB_COPYAREA
614615
select FB_CFB_IMAGEBLIT
@@ -2254,7 +2255,6 @@ config FB_SSD1307
22542255
select FB_SYS_COPYAREA
22552256
select FB_SYS_IMAGEBLIT
22562257
select FB_DEFERRED_IO
2257-
select PWM
22582258
select FB_BACKLIGHT
22592259
help
22602260
This driver implements support for the Solomon SSD1307

drivers/video/fbdev/controlfb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static int read_control_sense(struct fb_info_control *p)
376376
#define CONTROL_PIXCLOCK_MIN 5000 /* ~ 200 MHz dot clock */
377377

378378
/*
379-
* calculate the clock paramaters to be sent to CUDA according to given
379+
* calculate the clock parameters to be sent to CUDA according to given
380380
* pixclock in pico second.
381381
*/
382382
static int calc_clock_params(unsigned long clk, unsigned char *param)

drivers/video/fbdev/core/fbcon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2450,7 +2450,8 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount,
24502450

24512451
if (userfont) {
24522452
p->userfont = old_userfont;
2453-
REFCOUNT(data)--;
2453+
if (--REFCOUNT(data) == 0)
2454+
kfree(data - FONT_EXTRA_WORDS * sizeof(int));
24542455
}
24552456

24562457
vc->vc_font.width = old_width;

drivers/video/fbdev/da8xx-fb.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ static int fb_probe(struct platform_device *device)
14311431
dev_err(&device->dev,
14321432
"GLCD: kmalloc for frame buffer failed\n");
14331433
ret = -EINVAL;
1434-
goto err_release_fb;
1434+
goto err_disable_reg;
14351435
}
14361436

14371437
da8xx_fb_info->screen_base = (char __iomem *) par->vram_virt;
@@ -1475,7 +1475,7 @@ static int fb_probe(struct platform_device *device)
14751475

14761476
ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0);
14771477
if (ret)
1478-
goto err_release_fb;
1478+
goto err_disable_reg;
14791479
da8xx_fb_info->cmap.len = par->palette_sz;
14801480

14811481
/* initialize var_screeninfo */
@@ -1529,6 +1529,9 @@ static int fb_probe(struct platform_device *device)
15291529
err_dealloc_cmap:
15301530
fb_dealloc_cmap(&da8xx_fb_info->cmap);
15311531

1532+
err_disable_reg:
1533+
if (par->lcd_supply)
1534+
regulator_disable(par->lcd_supply);
15321535
err_release_fb:
15331536
framebuffer_release(da8xx_fb_info);
15341537

drivers/video/fbdev/ep93xx-fb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,12 +552,14 @@ static int ep93xxfb_probe(struct platform_device *pdev)
552552

553553
err = register_framebuffer(info);
554554
if (err)
555-
goto failed_check;
555+
goto failed_framebuffer;
556556

557557
dev_info(info->dev, "registered. Mode = %dx%d-%d\n",
558558
info->var.xres, info->var.yres, info->var.bits_per_pixel);
559559
return 0;
560560

561+
failed_framebuffer:
562+
clk_disable_unprepare(fbi->clk);
561563
failed_check:
562564
if (fbi->mach_info->teardown)
563565
fbi->mach_info->teardown(pdev);

drivers/video/fbdev/geode/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
config FB_GEODE
66
bool "AMD Geode family framebuffer support"
77
depends on FB && PCI && (X86_32 || (X86 && COMPILE_TEST))
8+
depends on !UML
89
help
910
Say 'Y' here to allow you to select framebuffer drivers for
1011
the AMD Geode family of processors.

drivers/video/fbdev/matrox/matroxfb_maven.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,8 +1249,7 @@ static int maven_shutdown_client(struct i2c_client* clnt) {
12491249
return 0;
12501250
}
12511251

1252-
static int maven_probe(struct i2c_client *client,
1253-
const struct i2c_device_id *id)
1252+
static int maven_probe(struct i2c_client *client)
12541253
{
12551254
struct i2c_adapter *adapter = client->adapter;
12561255
int err = -ENODEV;
@@ -1292,7 +1291,7 @@ static struct i2c_driver maven_driver={
12921291
.driver = {
12931292
.name = "maven",
12941293
},
1295-
.probe = maven_probe,
1294+
.probe_new = maven_probe,
12961295
.remove = maven_remove,
12971296
.id_table = maven_id,
12981297
};

drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/of.h>
1313

1414
#include <video/omapfb_dss.h>
15-
#include <video/omap-panel-data.h>
1615

1716
struct panel_drv_data {
1817
struct omap_dss_device dssdev;
@@ -178,70 +177,27 @@ static struct omap_dss_driver tvc_driver = {
178177
.set_wss = tvc_set_wss,
179178
};
180179

181-
static int tvc_probe_pdata(struct platform_device *pdev)
182-
{
183-
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
184-
struct connector_atv_platform_data *pdata;
185-
struct omap_dss_device *in, *dssdev;
186-
187-
pdata = dev_get_platdata(&pdev->dev);
188-
189-
in = omap_dss_find_output(pdata->source);
190-
if (in == NULL) {
191-
dev_err(&pdev->dev, "Failed to find video source\n");
192-
return -EPROBE_DEFER;
193-
}
194-
195-
ddata->in = in;
196-
197-
ddata->invert_polarity = pdata->invert_polarity;
198-
199-
dssdev = &ddata->dssdev;
200-
dssdev->name = pdata->name;
201-
202-
return 0;
203-
}
204-
205-
static int tvc_probe_of(struct platform_device *pdev)
206-
{
207-
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
208-
struct device_node *node = pdev->dev.of_node;
209-
struct omap_dss_device *in;
210-
211-
in = omapdss_of_find_source_for_first_ep(node);
212-
if (IS_ERR(in)) {
213-
dev_err(&pdev->dev, "failed to find video source\n");
214-
return PTR_ERR(in);
215-
}
216-
217-
ddata->in = in;
218-
219-
return 0;
220-
}
221-
222180
static int tvc_probe(struct platform_device *pdev)
223181
{
224182
struct panel_drv_data *ddata;
225183
struct omap_dss_device *dssdev;
226184
int r;
227185

186+
if (!pdev->dev.of_node)
187+
return -ENODEV;
188+
228189
ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
229190
if (!ddata)
230191
return -ENOMEM;
231192

232193
platform_set_drvdata(pdev, ddata);
233194
ddata->dev = &pdev->dev;
234195

235-
if (dev_get_platdata(&pdev->dev)) {
236-
r = tvc_probe_pdata(pdev);
237-
if (r)
238-
return r;
239-
} else if (pdev->dev.of_node) {
240-
r = tvc_probe_of(pdev);
241-
if (r)
242-
return r;
243-
} else {
244-
return -ENODEV;
196+
ddata->in = omapdss_of_find_source_for_first_ep(pdev->dev.of_node);
197+
r = PTR_ERR_OR_ZERO(ddata->in);
198+
if (r) {
199+
dev_err(&pdev->dev, "failed to find video source\n");
200+
return r;
245201
}
246202

247203
ddata->timings = tvc_pal_timings;

drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
* Author: Tomi Valkeinen <[email protected]>
77
*/
88

9+
#include <linux/err.h>
10+
#include <linux/gpio/consumer.h>
911
#include <linux/slab.h>
1012
#include <linux/module.h>
1113
#include <linux/platform_device.h>
1214
#include <linux/of.h>
13-
#include <linux/of_gpio.h>
1415

1516
#include <drm/drm_edid.h>
1617

@@ -41,7 +42,7 @@ struct panel_drv_data {
4142

4243
struct omap_video_timings timings;
4344

44-
int hpd_gpio;
45+
struct gpio_desc *hpd_gpio;
4546
};
4647

4748
#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
@@ -155,8 +156,8 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)
155156
struct panel_drv_data *ddata = to_panel_data(dssdev);
156157
struct omap_dss_device *in = ddata->in;
157158

158-
if (gpio_is_valid(ddata->hpd_gpio))
159-
return gpio_get_value_cansleep(ddata->hpd_gpio);
159+
if (ddata->hpd_gpio)
160+
return gpiod_get_value_cansleep(ddata->hpd_gpio);
160161
else
161162
return in->ops.hdmi->detect(in);
162163
}
@@ -197,31 +198,6 @@ static struct omap_dss_driver hdmic_driver = {
197198
.set_hdmi_infoframe = hdmic_set_infoframe,
198199
};
199200

200-
static int hdmic_probe_of(struct platform_device *pdev)
201-
{
202-
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
203-
struct device_node *node = pdev->dev.of_node;
204-
struct omap_dss_device *in;
205-
int gpio;
206-
207-
/* HPD GPIO */
208-
gpio = of_get_named_gpio(node, "hpd-gpios", 0);
209-
if (gpio_is_valid(gpio))
210-
ddata->hpd_gpio = gpio;
211-
else
212-
ddata->hpd_gpio = -ENODEV;
213-
214-
in = omapdss_of_find_source_for_first_ep(node);
215-
if (IS_ERR(in)) {
216-
dev_err(&pdev->dev, "failed to find video source\n");
217-
return PTR_ERR(in);
218-
}
219-
220-
ddata->in = in;
221-
222-
return 0;
223-
}
224-
225201
static int hdmic_probe(struct platform_device *pdev)
226202
{
227203
struct panel_drv_data *ddata;
@@ -238,15 +214,18 @@ static int hdmic_probe(struct platform_device *pdev)
238214
platform_set_drvdata(pdev, ddata);
239215
ddata->dev = &pdev->dev;
240216

241-
r = hdmic_probe_of(pdev);
217+
ddata->hpd_gpio = devm_gpiod_get_optional(&pdev->dev, "hpd", GPIOD_IN);
218+
r = PTR_ERR_OR_ZERO(ddata->hpd_gpio);
242219
if (r)
243220
return r;
244221

245-
if (gpio_is_valid(ddata->hpd_gpio)) {
246-
r = devm_gpio_request_one(&pdev->dev, ddata->hpd_gpio,
247-
GPIOF_DIR_IN, "hdmi_hpd");
248-
if (r)
249-
goto err_reg;
222+
gpiod_set_consumer_name(ddata->hpd_gpio, "hdmi_hpd");
223+
224+
ddata->in = omapdss_of_find_source_for_first_ep(pdev->dev.of_node);
225+
r = PTR_ERR_OR_ZERO(ddata->in);
226+
if (r) {
227+
dev_err(&pdev->dev, "failed to find video source\n");
228+
return r;
250229
}
251230

252231
ddata->timings = hdmic_default_timings;

drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
* Author: Tomi Valkeinen <[email protected]>
1212
*/
1313

14-
#include <linux/gpio.h>
14+
#include <linux/gpio/consumer.h>
1515
#include <linux/module.h>
16+
#include <linux/mod_devicetable.h>
1617
#include <linux/platform_device.h>
1718
#include <linux/slab.h>
18-
#include <linux/of_gpio.h>
1919

2020
#include <video/omapfb_dss.h>
2121

0 commit comments

Comments
 (0)