Skip to content

Commit

Permalink
Merge tag 'for-5.18/fbdev-1' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/deller/linux-fbdev

Pull fbdev updates from Helge Deller:
 "Lots of small fixes and code cleanups across most of the fbdev
  drivers.

  This includes conversions to use helper functions, const conversions,
  spelling fixes, help text updates, adding return value checks, small
  build fixes, and much more"

* tag 'for-5.18/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (59 commits)
  video: fbdev: kyro: make read-only array ODValues static const
  video: fbdev: offb: fix warning comparing pointer to 0
  video: fbdev: omapfb: Add missing of_node_put() in dvic_probe_of
  video: fbdev: sm712fb: Fix crash in smtcfb_write()
  video: fbdev: s3c-fb: fix platform_get_irq.cocci warning
  video: fbdev: sm712fb: Fix crash in smtcfb_read()
  video: fbdev: via: check the return value of kstrdup()
  video: fbdev: au1100fb: Spelling s/palette/palette/
  video: fbdev: atari: Atari 2 bpp (STe) palette bugfix
  video: fbdev: atari: Remove unused atafb_setcolreg()
  video: fbdev: atari: Convert to standard round_up() helper
  video: fbdev: atari: Fix TT High video mode
  video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit
  video: fbdev: omapfb: panel-tpo-td043mtea1: Use sysfs_emit() instead of snprintf()
  video: fbdev: omapfb: panel-dsi-cm: Use sysfs_emit() instead of snprintf()
  video: fbdev: omapfb: Use sysfs_emit() instead of snprintf()
  video: fbdev: s3c-fb: Use platform_get_irq() to get the interrupt
  video: fbdev: Fix wrong file path for pvr2fb.c in Kconfig help text
  video: fbdev: pxa3xx-gcu: Remove unnecessary print function dev_err()
  video: fbdev: pxa168fb: Remove unnecessary print function dev_err()
  ...
  • Loading branch information
torvalds committed Mar 23, 2022
2 parents 5bebe2c + e445c8b commit 9c4b86e
Show file tree
Hide file tree
Showing 54 changed files with 189 additions and 233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ description: |+
properties:
compatible:
items:
- enum:
- apple,simple-framebuffer
- allwinner,simple-framebuffer
- amlogic,simple-framebuffer
oneOf:
- items:
- enum:
- apple,simple-framebuffer
- allwinner,simple-framebuffer
- amlogic,simple-framebuffer
- const: simple-framebuffer
- const: simple-framebuffer

reg:
Expand Down
4 changes: 2 additions & 2 deletions arch/parisc/include/asm/agp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
*
*/

#define map_page_into_agp(page) /* nothing */
#define unmap_page_from_agp(page) /* nothing */
#define map_page_into_agp(page) do { } while (0)
#define unmap_page_from_agp(page) do { } while (0)
#define flush_agp_cache() mb()

/* GATT allocation. Returns/accepts GATT kernel virtual address. */
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/include/asm/agp.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include <asm/io.h>

#define map_page_into_agp(page)
#define unmap_page_from_agp(page)
#define map_page_into_agp(page) do {} while (0)
#define unmap_page_from_agp(page) do {} while (0)
#define flush_agp_cache() mb()

/* GATT allocation. Returns/accepts GATT kernel virtual address. */
Expand Down
6 changes: 3 additions & 3 deletions arch/sparc/include/asm/agp.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

/* dummy for now */

#define map_page_into_agp(page)
#define unmap_page_from_agp(page)
#define flush_agp_cache() mb()
#define map_page_into_agp(page) do { } while (0)
#define unmap_page_from_agp(page) do { } while (0)
#define flush_agp_cache() mb()

/* GATT allocation. Returns/accepts GATT kernel virtual address. */
#define alloc_gatt_pages(order) \
Expand Down
1 change: 0 additions & 1 deletion drivers/video/backlight/lm3630a_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ static int lm3630a_remove(struct i2c_client *client)

if (pchip->irq) {
free_irq(pchip->irq, pchip);
flush_workqueue(pchip->irqthread);
destroy_workqueue(pchip->irqthread);
}
return 0;
Expand Down
1 change: 1 addition & 0 deletions drivers/video/backlight/qcom-wled.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,6 +1734,7 @@ static const struct of_device_id wled_match_table[] = {
{ .compatible = "qcom,pmi8994-wled", .data = (void *)4 },
{ .compatible = "qcom,pmi8998-wled", .data = (void *)4 },
{ .compatible = "qcom,pm660l-wled", .data = (void *)4 },
{ .compatible = "qcom,pm6150l-wled", .data = (void *)5 },
{ .compatible = "qcom,pm8150l-wled", .data = (void *)5 },
{}
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ config FB_PVR2
You can pass several parameters to the driver at boot time or at
module load time. The parameters look like "video=pvr2:XXX", where
the meaning of XXX can be found at the end of the main source file
(<file:drivers/video/pvr2fb.c>). Please see the file
(<file:drivers/video/fbdev/pvr2fb.c>). Please see the file
<file:Documentation/fb/pvr2fb.rst>.

config FB_OPENCORES
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/asiliantfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static const struct fb_ops asiliantfb_ops = {
static void asiliant_calc_dclk2(u32 *ppixclock, u8 *dclk2_m, u8 *dclk2_n, u8 *dclk2_div)
{
unsigned pixclock = *ppixclock;
unsigned Ftarget = 1000000 * (1000000 / pixclock);
unsigned Ftarget;
unsigned n;
unsigned best_error = 0xffffffff;
unsigned best_m = 0xffffffff,
Expand Down
35 changes: 11 additions & 24 deletions drivers/video/fbdev/atafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
#define SWITCH_SND7 0x80
#define SWITCH_NONE 0x00

#define up(x, r) (((x) + (r) - 1) & ~((r)-1))


static int default_par; /* default resolution (0=none) */

Expand Down Expand Up @@ -487,8 +485,8 @@ static struct fb_videomode atafb_modedb[] __initdata = {
"tt-mid", 60, 640, 480, 31041, 120, 100, 8, 16, 140, 30,
0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
}, {
/* 1280x960, 29 kHz, 60 Hz (TT high) */
"tt-high", 57, 640, 960, 31041, 120, 100, 8, 16, 140, 30,
/* 1280x960, 72 kHz, 72 Hz (TT high) */
"tt-high", 57, 1280, 960, 7760, 260, 60, 36, 4, 192, 4,
0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
},

Expand Down Expand Up @@ -1649,12 +1647,12 @@ static int falcon_pan_display(struct fb_var_screeninfo *var,
int bpp = info->var.bits_per_pixel;

if (bpp == 1)
var->xoffset = up(var->xoffset, 32);
var->xoffset = round_up(var->xoffset, 32);
if (bpp != 16)
par->hw.falcon.xoffset = var->xoffset & 15;
else {
par->hw.falcon.xoffset = 0;
var->xoffset = up(var->xoffset, 2);
var->xoffset = round_up(var->xoffset, 2);
}
par->hw.falcon.line_offset = bpp *
(info->var.xres_virtual - info->var.xres) / 16;
Expand Down Expand Up @@ -1683,9 +1681,9 @@ static int falcon_setcolreg(unsigned int regno, unsigned int red,
((blue & 0xfc00) >> 8));
if (regno < 16) {
shifter_tt.color_reg[regno] =
(((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) |
(((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) |
((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12);
((((red & 0xe000) >> 13) | ((red & 0x1000) >> 12)) << 8) |
((((green & 0xe000) >> 13) | ((green & 0x1000) >> 12)) << 4) |
((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12);
((u32 *)info->pseudo_palette)[regno] = ((red & 0xf800) |
((green & 0xfc00) >> 5) |
((blue & 0xf800) >> 11));
Expand Down Expand Up @@ -1971,9 +1969,9 @@ static int stste_setcolreg(unsigned int regno, unsigned int red,
green >>= 12;
if (ATARIHW_PRESENT(EXTD_SHIFTER))
shifter_tt.color_reg[regno] =
(((red & 0xe) >> 1) | ((red & 1) << 3) << 8) |
(((green & 0xe) >> 1) | ((green & 1) << 3) << 4) |
((blue & 0xe) >> 1) | ((blue & 1) << 3);
((((red & 0xe) >> 1) | ((red & 1) << 3)) << 8) |
((((green & 0xe) >> 1) | ((green & 1) << 3)) << 4) |
((blue & 0xe) >> 1) | ((blue & 1) << 3);
else
shifter_tt.color_reg[regno] =
((red & 0xe) << 7) |
Expand Down Expand Up @@ -2268,7 +2266,7 @@ static int pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
if (!fbhw->set_screen_base ||
(!ATARIHW_PRESENT(EXTD_SHIFTER) && var->xoffset))
return -EINVAL;
var->xoffset = up(var->xoffset, 16);
var->xoffset = round_up(var->xoffset, 16);
par->screen_base = screen_base +
(var->yoffset * info->var.xres_virtual + var->xoffset)
* info->var.bits_per_pixel / 8;
Expand Down Expand Up @@ -2406,16 +2404,6 @@ static void atafb_set_disp(struct fb_info *info)
atari_stram_to_virt(info->fix.smem_start));
}

static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info)
{
red >>= 8;
green >>= 8;
blue >>= 8;

return info->fbops->fb_setcolreg(regno, red, green, blue, transp, info);
}

static int
atafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{
Expand Down Expand Up @@ -2726,7 +2714,6 @@ static struct fb_ops atafb_ops = {
.owner = THIS_MODULE,
.fb_check_var = atafb_check_var,
.fb_set_par = atafb_set_par,
.fb_setcolreg = atafb_setcolreg,
.fb_blank = atafb_blank,
.fb_pan_display = atafb_pan_display,
.fb_fillrect = atafb_fillrect,
Expand Down
11 changes: 6 additions & 5 deletions drivers/video/fbdev/atmel_lcdfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,15 +1062,16 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)

INIT_LIST_HEAD(&info->modelist);

if (pdev->dev.of_node) {
ret = atmel_lcdfb_of_init(sinfo);
if (ret)
goto free_info;
} else {
if (!pdev->dev.of_node) {
dev_err(dev, "cannot get default configuration\n");
goto free_info;
}

ret = atmel_lcdfb_of_init(sinfo);
if (ret)
goto free_info;

ret = -ENODEV;
if (!sinfo->config)
goto free_info;

Expand Down
10 changes: 6 additions & 4 deletions drivers/video/fbdev/aty/aty128fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ static void aty128_timings(struct aty128fb_par *par)
u32 x_mpll_ref_fb_div;
u32 xclk_cntl;
u32 Nx, M;
unsigned PostDivSet[] = { 0, 1, 2, 4, 8, 3, 6, 12 };
static const unsigned int PostDivSet[] = { 0, 1, 2, 4, 8, 3, 6, 12 };
#endif

if (!par->constants.ref_clk)
Expand Down Expand Up @@ -1321,8 +1321,10 @@ static void aty128_set_pll(struct aty128_pll *pll,
{
u32 div3;

unsigned char post_conv[] = /* register values for post dividers */
{ 2, 0, 1, 4, 2, 2, 6, 2, 3, 2, 2, 2, 7 };
/* register values for post dividers */
static const unsigned char post_conv[] = {
2, 0, 1, 4, 2, 2, 6, 2, 3, 2, 2, 2, 7
};

/* select PPLL_DIV_3 */
aty_st_le32(CLOCK_CNTL_INDEX, aty_ld_le32(CLOCK_CNTL_INDEX) | (3 << 8));
Expand Down Expand Up @@ -1360,7 +1362,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
const struct aty128fb_par *par)
{
const struct aty128_constants c = par->constants;
unsigned char post_dividers[] = {1,2,4,8,3,6,12};
static const unsigned char post_dividers[] = { 1, 2, 4, 8, 3, 6, 12 };
u32 output_freq;
u32 vclk; /* in .01 MHz */
int i = 0;
Expand Down
4 changes: 1 addition & 3 deletions drivers/video/fbdev/aty/mach64_ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ static u32 aty_pll_to_var_ct(const struct fb_info *info, const union aty_pll *pl

u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par)
{
u8 res;

/* write addr byte */
aty_st_8(CLOCK_CNTL_ADDR, (offset << 2) & PLL_ADDR, par);
/* read the register value */
res = aty_ld_8(CLOCK_CNTL_DATA, par);
return res;
return aty_ld_8(CLOCK_CNTL_DATA, par);
}

static void aty_st_pll_ct(int offset, u8 val, const struct atyfb_par *par)
Expand Down
2 changes: 0 additions & 2 deletions drivers/video/fbdev/aty/mach64_gx.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,8 @@ static int aty_var_to_pll_18818(const struct fb_info *info, u32 vclk_per,
post_divider = 1;

if (MHz100 > MAX_FREQ_2595) {
MHz100 = MAX_FREQ_2595;
return -EINVAL;
} else if (MHz100 < ABS_MIN_FREQ_2595) {
program_bits = 0; /* MHz100 = 257 */
return -EINVAL;
} else {
while (MHz100 < MIN_FREQ_2595) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/au1100fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned
u32 value;

fbdev = to_au1100fb_device(fbi);
palette = fbdev->regs->lcd_pallettebase;
palette = fbdev->regs->lcd_palettebase;

if (regno > (AU1100_LCD_NBR_PALETTE_ENTRIES - 1))
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/au1100fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct au1100fb_regs
u32 lcd_pwmdiv;
u32 lcd_pwmhi;
u32 reserved[(0x0400-0x002C)/4];
u32 lcd_pallettebase[256];
u32 lcd_palettebase[256];
};

struct au1100fb_device {
Expand Down
4 changes: 2 additions & 2 deletions drivers/video/fbdev/au1200fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,8 +1233,8 @@ static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct au1200fb_device *fbdev = info->par;

return dma_mmap_attrs(fbdev->dev, vma, fbdev->fb_mem, fbdev->fb_phys,
fbdev->fb_len, 0);
return dma_mmap_coherent(fbdev->dev, vma,
fbdev->fb_mem, fbdev->fb_phys, fbdev->fb_len);
}

static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
Expand Down
16 changes: 8 additions & 8 deletions drivers/video/fbdev/cirrusfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ static int cirrusfb_check_mclk(struct fb_info *info, long freq)
return 0;
}

static int cirrusfb_check_pixclock(const struct fb_var_screeninfo *var,
static int cirrusfb_check_pixclock(struct fb_var_screeninfo *var,
struct fb_info *info)
{
long freq;
Expand All @@ -478,21 +478,21 @@ static int cirrusfb_check_pixclock(const struct fb_var_screeninfo *var,
unsigned maxclockidx = var->bits_per_pixel >> 3;

/* convert from ps to kHz */
freq = PICOS2KHZ(var->pixclock);

dev_dbg(info->device, "desired pixclock: %ld kHz\n", freq);
freq = PICOS2KHZ(var->pixclock ? : 1);

maxclock = cirrusfb_board_info[cinfo->btype].maxclock[maxclockidx];
cinfo->multiplexing = 0;

/* If the frequency is greater than we can support, we might be able
* to use multiplexing for the video mode */
if (freq > maxclock) {
dev_err(info->device,
"Frequency greater than maxclock (%ld kHz)\n",
maxclock);
return -EINVAL;
var->pixclock = KHZ2PICOS(maxclock);

while ((freq = PICOS2KHZ(var->pixclock)) > maxclock)
var->pixclock++;
}
dev_dbg(info->device, "desired pixclock: %ld kHz\n", freq);

/*
* Additional constraint: 8bpp uses DAC clock doubling to allow maximum
* pixel clock
Expand Down
2 changes: 2 additions & 0 deletions drivers/video/fbdev/controlfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
#define out_8(addr, val) (void)(val)
#define in_le32(addr) 0
#define out_le32(addr, val) (void)(val)
#ifndef pgprot_cached_wthru
#define pgprot_cached_wthru(prot) (prot)
#endif
#else
static void invalid_vram_cache(void __force *addr)
{
Expand Down
Loading

0 comments on commit 9c4b86e

Please sign in to comment.