Commit d55696af authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fbdev-main-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into next

Pull main fbdev changes from Tomi Valkeinen:
 "Mainly fixes and small improvements.  The biggest change seems to be
  backlight control support for mx3fb"

* tag 'fbdev-main-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (31 commits)
  drivers/video/fbdev/fb-puv3.c: Add header files for function unifb_mmap
  video: fbdev: s3fb.c: Fix for possible null pointer dereference
  video: fbdev: grvga.c: Fix for possible null pointer dereference
  matroxfb: perform a dummy read of M_STATUS
  video: of: display_timing: fix default native-mode setting
  video: delete unneeded call to platform_get_drvdata
  video: mx3fb: Add backlight control support
  video: omap: delete support for early fbmem allocation
  video: of: display_timing: remove two unsafe error messages
  fbdev: fbmem: remove positive test on unsigned values
  fbcon: Fix memory leak in con2fb_release_oldinfo()
  video: Kconfig: Add a dependency to the Goldfish framebuffer driver
  video: exynos: Add a dependency to the menu
  video: mx3fb: Use devm_kzalloc
  video/nuc900: allow modular build
  video: atmel needs FB_BACKLIGHT
  video: export fb_prepare_logo
  video/mbx: fix building debugfs support
  video/omap: fix modular build
  video: clarify I2C dependencies
  ...
parents 4dc4226f fbc6c4a1
...@@ -748,6 +748,7 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo, ...@@ -748,6 +748,7 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo,
fbcon_del_cursor_timer(oldinfo); fbcon_del_cursor_timer(oldinfo);
kfree(ops->cursor_state.mask); kfree(ops->cursor_state.mask);
kfree(ops->cursor_data); kfree(ops->cursor_data);
kfree(ops->cursor_src);
kfree(ops->fontbuffer); kfree(ops->fontbuffer);
kfree(oldinfo->fbcon_par); kfree(oldinfo->fbcon_par);
oldinfo->fbcon_par = NULL; oldinfo->fbcon_par = NULL;
......
...@@ -360,6 +360,7 @@ config FB_CYBER2000_DDC ...@@ -360,6 +360,7 @@ config FB_CYBER2000_DDC
config FB_CYBER2000_I2C config FB_CYBER2000_I2C
bool "CyberPro 2000/2010/5000 I2C support" bool "CyberPro 2000/2010/5000 I2C support"
depends on FB_CYBER2000 && I2C && ARCH_NETWINDER depends on FB_CYBER2000 && I2C && ARCH_NETWINDER
depends on I2C=y || FB_CYBER2000=m
select I2C_ALGOBIT select I2C_ALGOBIT
help help
Enable support for the I2C video decoder interface on the Enable support for the I2C video decoder interface on the
...@@ -966,6 +967,7 @@ config FB_S1D13XXX ...@@ -966,6 +967,7 @@ config FB_S1D13XXX
config FB_ATMEL config FB_ATMEL
tristate "AT91/AT32 LCD Controller support" tristate "AT91/AT32 LCD Controller support"
depends on FB && HAVE_FB_ATMEL depends on FB && HAVE_FB_ATMEL
select FB_BACKLIGHT
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT
...@@ -1971,6 +1973,7 @@ config FB_W100 ...@@ -1971,6 +1973,7 @@ config FB_W100
config FB_SH_MOBILE_LCDC config FB_SH_MOBILE_LCDC
tristate "SuperH Mobile LCDC framebuffer support" tristate "SuperH Mobile LCDC framebuffer support"
depends on FB && (SUPERH || ARCH_SHMOBILE) && HAVE_CLK depends on FB && (SUPERH || ARCH_SHMOBILE) && HAVE_CLK
depends on FB_SH_MOBILE_MERAM || !FB_SH_MOBILE_MERAM
select FB_SYS_FILLRECT select FB_SYS_FILLRECT
select FB_SYS_COPYAREA select FB_SYS_COPYAREA
select FB_SYS_IMAGEBLIT select FB_SYS_IMAGEBLIT
...@@ -1993,7 +1996,7 @@ config FB_SH_MOBILE_HDMI ...@@ -1993,7 +1996,7 @@ config FB_SH_MOBILE_HDMI
config FB_TMIO config FB_TMIO
tristate "Toshiba Mobile IO FrameBuffer support" tristate "Toshiba Mobile IO FrameBuffer support"
depends on FB && MFD_CORE depends on FB && (MFD_TMIO || COMPILE_TEST)
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT
...@@ -2062,7 +2065,7 @@ config FB_S3C2410_DEBUG ...@@ -2062,7 +2065,7 @@ config FB_S3C2410_DEBUG
through sysfs through sysfs
config FB_NUC900 config FB_NUC900
bool "NUC900 LCD framebuffer support" tristate "NUC900 LCD framebuffer support"
depends on FB && ARCH_W90X900 depends on FB && ARCH_W90X900
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
...@@ -2169,7 +2172,7 @@ config FB_XILINX ...@@ -2169,7 +2172,7 @@ config FB_XILINX
config FB_GOLDFISH config FB_GOLDFISH
tristate "Goldfish Framebuffer" tristate "Goldfish Framebuffer"
depends on FB && HAS_DMA depends on FB && HAS_DMA && (GOLDFISH || COMPILE_TEST)
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT
...@@ -2295,6 +2298,7 @@ endchoice ...@@ -2295,6 +2298,7 @@ endchoice
config FB_MB862XX_I2C config FB_MB862XX_I2C
bool "Support I2C bus on MB862XX GDC" bool "Support I2C bus on MB862XX GDC"
depends on FB_MB862XX && I2C depends on FB_MB862XX && I2C
depends on FB_MB862XX=m || I2C=y
default y default y
help help
Selecting this option adds Coral-P(A)/Lime GDC I2C bus adapter Selecting this option adds Coral-P(A)/Lime GDC I2C bus adapter
...@@ -2332,6 +2336,7 @@ config FB_MX3 ...@@ -2332,6 +2336,7 @@ config FB_MX3
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT
select BACKLIGHT_CLASS_DEVICE
default y default y
help help
This is a framebuffer device for the i.MX31 LCD Controller. So This is a framebuffer device for the i.MX31 LCD Controller. So
......
...@@ -717,8 +717,6 @@ static int bfin_bf54x_remove(struct platform_device *pdev) ...@@ -717,8 +717,6 @@ static int bfin_bf54x_remove(struct platform_device *pdev)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int bfin_bf54x_suspend(struct platform_device *pdev, pm_message_t state) static int bfin_bf54x_suspend(struct platform_device *pdev, pm_message_t state)
{ {
struct fb_info *fbinfo = platform_get_drvdata(pdev);
bfin_write_EPPI0_CONTROL(bfin_read_EPPI0_CONTROL() & ~EPPI_EN); bfin_write_EPPI0_CONTROL(bfin_read_EPPI0_CONTROL() & ~EPPI_EN);
disable_dma(CH_EPPI0); disable_dma(CH_EPPI0);
bfin_write_EPPI0_STATUS(0xFFFF); bfin_write_EPPI0_STATUS(0xFFFF);
......
...@@ -433,7 +433,7 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, ...@@ -433,7 +433,7 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
image->dx += image->width + 8; image->dx += image->width + 8;
} }
} else if (rotate == FB_ROTATE_UD) { } else if (rotate == FB_ROTATE_UD) {
for (x = 0; x < num && image->dx >= 0; x++) { for (x = 0; x < num; x++) {
info->fbops->fb_imageblit(info, image); info->fbops->fb_imageblit(info, image);
image->dx -= image->width + 8; image->dx -= image->width + 8;
} }
...@@ -445,7 +445,7 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, ...@@ -445,7 +445,7 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
image->dy += image->height + 8; image->dy += image->height + 8;
} }
} else if (rotate == FB_ROTATE_CCW) { } else if (rotate == FB_ROTATE_CCW) {
for (x = 0; x < num && image->dy >= 0; x++) { for (x = 0; x < num; x++) {
info->fbops->fb_imageblit(info, image); info->fbops->fb_imageblit(info, image);
image->dy -= image->height + 8; image->dy -= image->height + 8;
} }
...@@ -674,6 +674,7 @@ int fb_show_logo(struct fb_info *info, int rotate) ...@@ -674,6 +674,7 @@ int fb_show_logo(struct fb_info *info, int rotate)
int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; } int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; }
int fb_show_logo(struct fb_info *info, int rotate) { return 0; } int fb_show_logo(struct fb_info *info, int rotate) { return 0; }
#endif /* CONFIG_LOGO */ #endif /* CONFIG_LOGO */
EXPORT_SYMBOL(fb_prepare_logo);
EXPORT_SYMBOL(fb_show_logo); EXPORT_SYMBOL(fb_show_logo);
static void *fb_seq_start(struct seq_file *m, loff_t *pos) static void *fb_seq_start(struct seq_file *m, loff_t *pos)
...@@ -1179,7 +1180,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, ...@@ -1179,7 +1180,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
return -EFAULT; return -EFAULT;
if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES)
return -EINVAL; return -EINVAL;
if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX) if (con2fb.framebuffer >= FB_MAX)
return -EINVAL; return -EINVAL;
if (!registered_fb[con2fb.framebuffer]) if (!registered_fb[con2fb.framebuffer])
request_module("fb%d", con2fb.framebuffer); request_module("fb%d", con2fb.framebuffer);
......
...@@ -1012,13 +1012,20 @@ void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs) ...@@ -1012,13 +1012,20 @@ void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
while (pos < edid[2]) { while (pos < edid[2]) {
u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7; u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7;
pr_debug("Data block %u of %u bytes\n", type, len); pr_debug("Data block %u of %u bytes\n", type, len);
if (type == 2) if (type == 2) {
for (i = pos; i < pos + len; i++) { for (i = pos; i < pos + len; i++) {
u8 idx = edid[pos + i] & 0x7f; u8 idx = edid[pos + i] & 0x7f;
svd[svd_n++] = idx; svd[svd_n++] = idx;
pr_debug("N%sative mode #%d\n", pr_debug("N%sative mode #%d\n",
edid[pos + i] & 0x80 ? "" : "on-n", idx); edid[pos + i] & 0x80 ? "" : "on-n", idx);
} }
} else if (type == 3 && len >= 3) {
/* Check Vendor Specific Data Block. For HDMI,
it is always 00-0C-03 for HDMI Licensing, LLC. */
if (edid[pos + 1] == 3 && edid[pos + 2] == 0xc &&
edid[pos + 3] == 0)
specs->misc |= FB_MISC_HDMI;
}
pos += len + 1; pos += len + 1;
} }
......
...@@ -242,6 +242,20 @@ static struct fb_videomode known_lcd_panels[] = { ...@@ -242,6 +242,20 @@ static struct fb_videomode known_lcd_panels[] = {
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.flag = 0, .flag = 0,
}, },
[3] = {
/* Densitron 84-0023-001T */
.name = "Densitron_84-0023-001T",
.xres = 320,
.yres = 240,
.pixclock = KHZ2PICOS(6400),
.left_margin = 0,
.right_margin = 0,
.upper_margin = 0,
.lower_margin = 0,
.hsync_len = 30,
.vsync_len = 3,
.sync = 0,
},
}; };
static bool da8xx_fb_is_raster_enabled(void) static bool da8xx_fb_is_raster_enabled(void)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
menuconfig EXYNOS_VIDEO menuconfig EXYNOS_VIDEO
bool "Exynos Video driver support" bool "Exynos Video driver support"
depends on ARCH_S5PV210 || ARCH_EXYNOS
help help
This enables support for EXYNOS Video device. This enables support for EXYNOS Video device.
...@@ -15,7 +16,6 @@ if EXYNOS_VIDEO ...@@ -15,7 +16,6 @@ if EXYNOS_VIDEO
config EXYNOS_MIPI_DSI config EXYNOS_MIPI_DSI
bool "EXYNOS MIPI DSI driver support." bool "EXYNOS MIPI DSI driver support."
depends on ARCH_S5PV210 || ARCH_EXYNOS
select GENERIC_PHY select GENERIC_PHY
help help
This enables support for MIPI-DSI device. This enables support for MIPI-DSI device.
......
...@@ -18,8 +18,10 @@ ...@@ -18,8 +18,10 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/mm.h>
#include <asm/sizes.h> #include <asm/sizes.h>
#include <asm/pgtable.h>
#include <mach/hardware.h> #include <mach/hardware.h>
/* Platform_data reserved for unifb registers. */ /* Platform_data reserved for unifb registers. */
......
...@@ -1068,7 +1068,7 @@ static struct fb_ops gbefb_ops = { ...@@ -1068,7 +1068,7 @@ static struct fb_ops gbefb_ops = {
static ssize_t gbefb_show_memsize(struct device *dev, struct device_attribute *attr, char *buf) static ssize_t gbefb_show_memsize(struct device *dev, struct device_attribute *attr, char *buf)
{ {
return snprintf(buf, PAGE_SIZE, "%d\n", gbe_mem_size); return snprintf(buf, PAGE_SIZE, "%u\n", gbe_mem_size);
} }
static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL); static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL);
......
...@@ -514,9 +514,10 @@ static int grvga_probe(struct platform_device *dev) ...@@ -514,9 +514,10 @@ static int grvga_probe(struct platform_device *dev)
static int grvga_remove(struct platform_device *device) static int grvga_remove(struct platform_device *device)
{ {
struct fb_info *info = dev_get_drvdata(&device->dev); struct fb_info *info = dev_get_drvdata(&device->dev);
struct grvga_par *par = info->par; struct grvga_par *par;
if (info) { if (info) {
par = info->par;
unregister_framebuffer(info); unregister_framebuffer(info);
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
......
...@@ -698,7 +698,7 @@ void matroxfb_unregister_driver(struct matroxfb_driver* drv); ...@@ -698,7 +698,7 @@ void matroxfb_unregister_driver(struct matroxfb_driver* drv);
#define mga_fifo(n) do {} while ((mga_inl(M_FIFOSTATUS) & 0xFF) < (n)) #define mga_fifo(n) do {} while ((mga_inl(M_FIFOSTATUS) & 0xFF) < (n))
#define WaitTillIdle() do {} while (mga_inl(M_STATUS) & 0x10000) #define WaitTillIdle() do { mga_inl(M_STATUS); do {} while (mga_inl(M_STATUS) & 0x10000); } while (0)
/* code speedup */ /* code speedup */
#ifdef CONFIG_FB_MATROX_MILLENIUM #ifdef CONFIG_FB_MATROX_MILLENIUM
......
# Makefile for the 2700G controller driver. # Makefile for the 2700G controller driver.
obj-$(CONFIG_FB_MBX) += mbxfb.o obj-y += mbxfb.o
obj-$(CONFIG_FB_MBX_DEBUG) += mbxfbdebugfs.o
...@@ -17,7 +17,7 @@ struct mbxfb_debugfs_data { ...@@ -17,7 +17,7 @@ struct mbxfb_debugfs_data {
static int open_file_generic(struct inode *inode, struct file *file) static int open_file_generic(struct inode *inode, struct file *file)
{ {
file->private_data = inode->u.generic_ip; file->private_data = inode->i_private;
return 0; return 0;
} }
......
...@@ -877,6 +877,8 @@ static int mbxfb_resume(struct platform_device *dev) ...@@ -877,6 +877,8 @@ static int mbxfb_resume(struct platform_device *dev)
#ifndef CONFIG_FB_MBX_DEBUG #ifndef CONFIG_FB_MBX_DEBUG
#define mbxfb_debugfs_init(x) do {} while(0) #define mbxfb_debugfs_init(x) do {} while(0)
#define mbxfb_debugfs_remove(x) do {} while(0) #define mbxfb_debugfs_remove(x) do {} while(0)
#else
#include "mbxdebugfs.c"
#endif #endif
#define res_size(_r) (((_r)->end - (_r)->start) + 1) #define res_size(_r) (((_r)->end - (_r)->start) + 1)
......
menuconfig MMP_DISP menuconfig MMP_DISP
tristate "Marvell MMP Display Subsystem support" tristate "Marvell MMP Display Subsystem support"
depends on CPU_PXA910 || CPU_MMP2 || CPU_MMP3 || CPU_PXA988 depends on CPU_PXA910 || CPU_MMP2
help help
Marvell Display Subsystem support. Marvell Display Subsystem support.
......
...@@ -554,8 +554,8 @@ static void fb_info_clear(struct fb_info *info) ...@@ -554,8 +554,8 @@ static void fb_info_clear(struct fb_info *info)
static int mmpfb_probe(struct platform_device *pdev) static int mmpfb_probe(struct platform_device *pdev)
{ {
struct mmp_buffer_driver_mach_info *mi; struct mmp_buffer_driver_mach_info *mi;
struct fb_info *info = 0; struct fb_info *info;
struct mmpfb_info *fbi = 0; struct mmpfb_info *fbi;
int ret, modes_num; int ret, modes_num;
mi = pdev->dev.platform_data; mi = pdev->dev.platform_data;
...@@ -569,10 +569,6 @@ static int mmpfb_probe(struct platform_device *pdev) ...@@ -569,10 +569,6 @@ static int mmpfb_probe(struct platform_device *pdev)
if (info == NULL) if (info == NULL)
return -ENOMEM; return -ENOMEM;
fbi = info->par; fbi = info->par;
if (!fbi) {
ret = -EINVAL;
goto failed;
}
/* init fb */ /* init fb */
fbi->fb_info = info; fbi->fb_info = info;
...@@ -667,7 +663,6 @@ static int mmpfb_probe(struct platform_device *pdev) ...@@ -667,7 +663,6 @@ static int mmpfb_probe(struct platform_device *pdev)
fbi->fb_start_dma); fbi->fb_start_dma);
failed_destroy_mutex: failed_destroy_mutex:
mutex_destroy(&fbi->access_ok); mutex_destroy(&fbi->access_ok);
failed:
dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n"); dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n");
framebuffer_release(info); framebuffer_release(info);
......
...@@ -2,12 +2,12 @@ if MMP_DISP ...@@ -2,12 +2,12 @@ if MMP_DISP
config MMP_DISP_CONTROLLER config MMP_DISP_CONTROLLER
bool "mmp display controller hw support" bool "mmp display controller hw support"
depends on CPU_PXA910 || CPU_MMP2 || CPU_MMP3 || CPU_PXA988 depends on CPU_PXA910 || CPU_MMP2
default n default n
help help
Marvell MMP display hw controller support Marvell MMP display hw controller support
this controller is used on Marvell PXA910, this controller is used on Marvell PXA910 and
MMP2, MMP3, PXA988 chips MMP2 chips
config MMP_DISP_SPI config MMP_DISP_SPI
bool "mmp display controller spi port" bool "mmp display controller spi port"
......
...@@ -167,11 +167,7 @@ struct lcd_regs { ...@@ -167,11 +167,7 @@ struct lcd_regs {
PN2_IOPAD_CONTROL) : LCD_TOP_CTRL) PN2_IOPAD_CONTROL) : LCD_TOP_CTRL)
/* dither configure */ /* dither configure */
#ifdef CONFIG_CPU_PXA988
#define LCD_DITHER_CTRL (0x01EC)
#else
#define LCD_DITHER_CTRL (0x00A0) #define LCD_DITHER_CTRL (0x00A0)
#endif
#define DITHER_TBL_INDEX_SEL(s) ((s) << 16) #define DITHER_TBL_INDEX_SEL(s) ((s) << 16)
#define DITHER_MODE2(m) ((m) << 12) #define DITHER_MODE2(m) ((m) << 12)
...@@ -186,15 +182,6 @@ struct lcd_regs { ...@@ -186,15 +182,6 @@ struct lcd_regs {
#define DITHER_EN1 (1) #define DITHER_EN1 (1)
/* dither table data was fixed by video bpp of input and output*/ /* dither table data was fixed by video bpp of input and output*/
#ifdef CONFIG_CPU_PXA988
#define DITHER_TB_4X4_INDEX0 (0x6e4ca280)
#define DITHER_TB_4X4_INDEX1 (0x5d7f91b3)
#define DITHER_TB_4X8_INDEX0 (0xb391a280)
#define DITHER_TB_4X8_INDEX1 (0x7f5d6e4c)
#define DITHER_TB_4X8_INDEX2 (0x80a291b3)
#define DITHER_TB_4X8_INDEX3 (0x4c6e5d7f)
#define LCD_DITHER_TBL_DATA (0x01F0)
#else
#define DITHER_TB_4X4_INDEX0 (0x3b19f7d5) #define DITHER_TB_4X4_INDEX0 (0x3b19f7d5)
#define DITHER_TB_4X4_INDEX1 (0x082ac4e6) #define DITHER_TB_4X4_INDEX1 (0x082ac4e6)
#define DITHER_TB_4X8_INDEX0 (0xf7d508e6) #define DITHER_TB_4X8_INDEX0 (0xf7d508e6)
...@@ -202,7 +189,6 @@ struct lcd_regs { ...@@ -202,7 +189,6 @@ struct lcd_regs {
#define DITHER_TB_4X8_INDEX2 (0xc4e6d5f7) #define DITHER_TB_4X8_INDEX2 (0xc4e6d5f7)
#define DITHER_TB_4X8_INDEX3 (0x082a193b) #define DITHER_TB_4X8_INDEX3 (0x082a193b)
#define LCD_DITHER_TBL_DATA (0x00A4) #define LCD_DITHER_TBL_DATA (0x00A4)
#endif
/* Video Frame 0&1 start address registers */ /* Video Frame 0&1 start address registers */
#define LCD_SPU_DMA_START_ADDR_Y0 0x00C0 #define LCD_SPU_DMA_START_ADDR_Y0 0x00C0
...@@ -933,16 +919,9 @@ struct lcd_regs { ...@@ -933,16 +919,9 @@ struct lcd_regs {
#define LCD_PN2_SQULN2_CTRL (0x02F0) #define LCD_PN2_SQULN2_CTRL (0x02F0)
#define ALL_LAYER_ALPHA_SEL (0x02F4) #define ALL_LAYER_ALPHA_SEL (0x02F4)
/* pxa988 has different MASTER_CTRL from MMP3/MMP2 */
#ifdef CONFIG_CPU_PXA988
#define TIMING_MASTER_CONTROL (0x01F4)
#define MASTER_ENH(id) (1 << ((id) + 5))
#define MASTER_ENV(id) (1 << ((id) + 6))
#else
#define TIMING_MASTER_CONTROL (0x02F8) #define TIMING_MASTER_CONTROL (0x02F8)
#define MASTER_ENH(id) (1 << (id)) #define MASTER_ENH(id) (1 << (id))
#define MASTER_ENV(id) (1 << ((id) + 4)) #define MASTER_ENV(id) (1 << ((id) + 4))
#endif
#define DSI_START_SEL_SHIFT(id) (((id) << 1) + 8) #define DSI_START_SEL_SHIFT(id) (((id) << 1) + 8)
#define timing_master_config(path, dsi_id, lcd_id) \ #define timing_master_config(path, dsi_id, lcd_id) \
...@@ -1312,19 +1291,8 @@ struct dsi_regs { ...@@ -1312,19 +1291,8 @@ struct dsi_regs {
#define DSI_PHY_TIME_3_CFG_CSR_TIME_REQRDY_MASK (0xff) #define DSI_PHY_TIME_3_CFG_CSR_TIME_REQRDY_MASK (0xff)
#define DSI_PHY_TIME_3_CFG_CSR_TIME_REQRDY_SHIFT 0 #define DSI_PHY_TIME_3_CFG_CSR_TIME_REQRDY_SHIFT 0
/*
* DSI timings
* PXA988 has diffrent ESC CLK with MMP2/MMP3
* it will be used in dsi_set_dphy() in pxa688_phy.c
* as low power mode clock.
*/
#ifdef CONFIG_CPU_PXA988
#define DSI_ESC_CLK 52 /* Unit: Mhz */
#define DSI_ESC_CLK_T 19 /* Unit: ns */
#else
#define DSI_ESC_CLK 66 /* Unit: Mhz */ #define DSI_ESC_CLK 66 /* Unit: Mhz */
#define DSI_ESC_CLK_T 15 /* Unit: ns */ #define DSI_ESC_CLK_T 15 /* Unit: ns */
#endif
/* LVDS */ /* LVDS */
/* LVDS_PHY_CTRL */ /* LVDS_PHY_CTRL */
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/dma/ipu-dma.h> #include <linux/dma/ipu-dma.h>
#include <linux/backlight.h>
#include <linux/platform_data/dma-imx.h> #include <linux/platform_data/dma-imx.h>
#include <linux/platform_data/video-mx3fb.h> #include <linux/platform_data/video-mx3fb.h>
...@@ -241,6 +242,7 @@ struct mx3fb_data { ...@@ -241,6 +242,7 @@ struct mx3fb_data {
void __iomem *reg_base; void __iomem *reg_base;
spinlock_t lock; spinlock_t lock;
struct device *dev; struct device *dev;
struct backlight_device *bl;
uint32_t h_start_width; uint32_t h_start_width;
uint32_t v_start_width; uint32_t v_start_width;
...@@ -271,6 +273,71 @@ struct mx3fb_info { ...@@ -271,6 +273,71 @@ struct mx3fb_info {
struct fb_var_screeninfo cur_var; /* current var info */ struct fb_var_screeninfo cur_var; /* current var info */
}; };
static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value);
static u32 sdc_get_brightness(struct mx3fb_data *mx3fb);
static int mx3fb_bl_get_brightness(struct backlight_device *bl)
{
struct mx3fb_data *fbd = bl_get_data(bl);
return sdc_get_brightness(fbd);
}
static int mx3fb_bl_update_status(struct backlight_device *bl)
{
struct mx3fb_data *fbd = bl_get_data(bl);
int brightness = bl->props.brightness;
if (bl->props.power != FB_BLANK_UNBLANK)
brightness = 0;
if (bl->props.fb_blank != FB_BLANK_UNBLANK)
brightness = 0;
fbd->backlight_level = (fbd->backlight_level & ~0xFF) | brightness;
sdc_set_brightness(fbd, fbd->backlight_level);
return 0;
}
static const struct backlight_ops mx3fb_lcdc_bl_ops = {
.update_status = mx3fb_bl_update_status,
.get_brightness = mx3fb_bl_get_brightness,
};
static void mx3fb_init_backlight(struct mx3fb_data *fbd)
{
struct backlight_properties props;
struct backlight_device *bl;
if (fbd->bl)
return;
memset(&props, 0, sizeof(struct backlight_properties));
props.max_brightness = 0xff;
props.type = BACKLIGHT_RAW;
sdc_set_brightness(fbd, fbd->backlight_level);
bl = backlight_device_register("mx3fb-bl", fbd->dev, fbd,
&mx3fb_lcdc_bl_ops, &props);
if (IS_ERR(bl)) {
dev_err(fbd->dev, "error %ld on backlight register\n",
PTR_ERR(bl));
return;
}
fbd->bl = bl;
bl->props.power = FB_BLANK_UNBLANK;
bl->props.fb_blank = FB_BLANK_UNBLANK;
bl->props.brightness = mx3fb_bl_get_brightness(bl);
}
static void mx3fb_exit_backlight(struct mx3fb_data *fbd)
{
if (fbd->bl)
backlight_device_unregister(fbd->bl);
}
static void mx3fb_dma_done(void *); static void mx3fb_dma_done(void *);
/* Used fb-mode and bpp. Can be set on kernel command line, therefore file-static. */ /* Used fb-mode and bpp. Can be set on kernel command line, therefore file-static. */
...@@ -628,6 +695,16 @@ static int sdc_set_global_alpha(struct mx3fb_data *mx3fb, bool enable, uint8_t a ...@@ -628,6 +695,16 @@ static int sdc_set_global_alpha(struct mx3fb_data *mx3fb, bool enable, uint8_t a
return 0; return 0;
} }
static u32 sdc_get_brightness(struct mx3fb_data *mx3fb)
{
u32 brightness;
brightness = mx3fb_read_reg(mx3fb, SDC_PWM_CTRL);
brightness = (brightness >> 16) & 0xFF;
return brightness;
}
static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value) static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value)
{ {
dev_dbg(mx3fb->dev, "%s: value = %d\n", __func__, value); dev_dbg(mx3fb->dev, "%s: value = %d\n", __func__, value);
...@@ -1496,7 +1573,7 @@ static int mx3fb_probe(struct platform_device *pdev) ...@@ -1496,7 +1573,7 @@ static int mx3fb_probe(struct platform_device *pdev)
if (!sdc_reg) if (!sdc_reg)
return -EINVAL; return -EINVAL;
mx3fb = kzalloc(sizeof(*mx3fb), GFP_KERNEL); mx3fb = devm_kzalloc(&pdev->dev, sizeof(*mx3fb), GFP_KERNEL);
if (!mx3fb) if (!mx3fb)
return -ENOMEM; return -ENOMEM;
...@@ -1534,6 +1611,8 @@ static int mx3fb_probe(struct platform_device *pdev) ...@@ -1534,6 +1611,8 @@ static int mx3fb_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto eisdc0; goto eisdc0;
mx3fb_init_backlight(mx3fb);
return 0; return 0;
eisdc0: eisdc0:
...@@ -1542,7 +1621,6 @@ static int mx3fb_probe(struct platform_device *pdev) ...@@ -1542,7 +1621,6 @@ static int mx3fb_probe(struct platform_device *pdev)
dmaengine_put(); dmaengine_put();
iounmap(mx3fb->reg_base); iounmap(mx3fb->reg_base);
eremap: eremap:
kfree(mx3fb);
dev_err(dev, "mx3fb: failed to register fb\n"); dev_err(dev, "mx3fb: failed to register fb\n");
return ret; return ret;
} }
...@@ -1557,11 +1635,12 @@ static int mx3fb_remove(struct platform_device *dev) ...@@ -1557,11 +1635,12 @@ static int mx3fb_remove(struct platform_device *dev)
chan = &mx3_fbi->idmac_channel->dma_chan; chan = &mx3_fbi->idmac_channel->dma_chan;
release_fbi(fbi); release_fbi(fbi);
mx3fb_exit_backlight(mx3fb);
dma_release_channel(chan); dma_release_channel(chan);
dmaengine_put(); dmaengine_put();
iounmap(mx3fb->reg_base); iounmap(mx3fb->reg_base);
kfree(mx3fb);
return 0; return 0;
} }
......
...@@ -39,6 +39,15 @@ config FB_OMAP_LCD_MIPID ...@@ -39,6 +39,15 @@ config FB_OMAP_LCD_MIPID
the Mobile Industry Processor Interface DBI-C/DCS the Mobile Industry Processor Interface DBI-C/DCS
specification. (Supported LCDs: Philips LPH8923, Sharp LS041Y3) specification. (Supported LCDs: Philips LPH8923, Sharp LS041Y3)
config FB_OMAP_LCD_H3
bool "TPS65010 LCD controller on OMAP-H3"
depends on MACH_OMAP_H3
depends on TPS65010
default y
help
Say Y here if you want to have support for the LCD on the
H3 board.
config FB_OMAP_DMA_TUNE config FB_OMAP_DMA_TUNE
bool "Set DMA SDRAM access priority high" bool "Set DMA SDRAM access priority high"
depends on FB_OMAP depends on FB_OMAP
......
...@@ -10,17 +10,18 @@ objs-y$(CONFIG_FB_OMAP_LCDC_EXTERNAL) += sossi.o ...@@ -10,17 +10,18 @@ objs-y$(CONFIG_FB_OMAP_LCDC_EXTERNAL) += sossi.o
objs-y$(CONFIG_FB_OMAP_LCDC_HWA742) += hwa742.o objs-y$(CONFIG_FB_OMAP_LCDC_HWA742) += hwa742.o
objs-y$(CONFIG_MACH_AMS_DELTA) += lcd_ams_delta.o lcds-y$(CONFIG_MACH_AMS_DELTA) += lcd_ams_delta.o
objs-y$(CONFIG_MACH_OMAP_H3) += lcd_h3.o lcds-y$(CONFIG_FB_OMAP_LCD_H3) += lcd_h3.o
objs-y$(CONFIG_MACH_OMAP_PALMTE) += lcd_palmte.o lcds-y$(CONFIG_MACH_OMAP_PALMTE) += lcd_palmte.o
objs-y$(CONFIG_MACH_OMAP_PALMTT) += lcd_palmtt.o lcds-y$(CONFIG_MACH_OMAP_PALMTT) += lcd_palmtt.o
objs-y$(CONFIG_MACH_OMAP_PALMZ71) += lcd_palmz71.o lcds-y$(CONFIG_MACH_OMAP_PALMZ71) += lcd_palmz71.o
objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o lcds-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o
objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o lcds-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o
objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o lcds-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o
objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o lcds-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o
objs-y$(CONFIG_MACH_HERALD) += lcd_htcherald.o lcds-y$(CONFIG_MACH_HERALD) += lcd_htcherald.o
omapfb-objs := $(objs-yy) omapfb-objs := $(objs-yy)
obj-$(CONFIG_FB_OMAP) += $(lcds-yy)
...@@ -74,7 +74,6 @@ static struct omap_lcd_controller { ...@@ -74,7 +74,6 @@ static struct omap_lcd_controller {
void (*dma_callback)(void *data); void (*dma_callback)(void *data);
void *dma_callback_data; void *dma_callback_data;
int fbmem_allocated;
dma_addr_t vram_phys; dma_addr_t vram_phys;
void *vram_virt; void *vram_virt;
unsigned long vram_size; unsigned long vram_size;
...@@ -611,42 +610,6 @@ static void lcdc_dma_handler(u16 status, void *data) ...@@ -611,42 +610,6 @@ static void lcdc_dma_handler(u16 status, void *data)
lcdc.dma_callback(lcdc.dma_callback_data); lcdc.dma_callback(lcdc.dma_callback_data);
} }
static int mmap_kern(void)
{
struct vm_struct *kvma;
struct vm_area_struct vma;
pgprot_t pgprot;
unsigned long vaddr;
kvma = get_vm_area(lcdc.vram_size, VM_IOREMAP);
if (kvma == NULL) {
dev_err(lcdc.fbdev->dev, "can't get kernel vm area\n");
return -ENOMEM;
}
vma.vm_mm = &init_mm;
vaddr = (unsigned long)kvma->addr;
vma.vm_start = vaddr;
vma.vm_end = vaddr + lcdc.vram_size;
pgprot = pgprot_writecombine(pgprot_kernel);
if (io_remap_pfn_range(&vma, vaddr,
lcdc.vram_phys >> PAGE_SHIFT,
lcdc.vram_size, pgprot) < 0) {
dev_err(lcdc.fbdev->dev, "kernel mmap for FB memory failed\n");
return -EAGAIN;
}
lcdc.vram_virt = (void *)vaddr;
return 0;
}
static void unmap_kern(void)
{
vunmap(lcdc.vram_virt);
}
static int alloc_palette_ram(void) static int alloc_palette_ram(void)
{ {
lcdc.palette_virt = dma_alloc_writecombine(lcdc.fbdev->dev, lcdc.palette_virt = dma_alloc_writecombine(lcdc.fbdev->dev,
...@@ -703,8 +666,6 @@ static void free_fbmem(void) ...@@ -703,8 +666,6 @@ static void free_fbmem(void)
static int setup_fbmem(struct omapfb_mem_desc *req_md) static int setup_fbmem(struct omapfb_mem_desc *req_md)
{ {
int r;
if (!req_md->region_cnt) { if (!req_md->region_cnt) {
dev_err(lcdc.fbdev->dev, "no memory regions defined\n"); dev_err(lcdc.fbdev->dev, "no memory regions defined\n");
return -EINVAL; return -EINVAL;
...@@ -715,31 +676,7 @@ static int setup_fbmem(struct omapfb_mem_desc *req_md) ...@@ -715,31 +676,7 @@ static int setup_fbmem(struct omapfb_mem_desc *req_md)
req_md->region_cnt = 1; req_md->region_cnt = 1;
} }
if (req_md->region[0].paddr == 0) { return alloc_fbmem(&req_md->region[0]);
lcdc.fbmem_allocated = 1;
if ((r = alloc_fbmem(&req_md->region[0])) < 0)
return r;
return 0;
}
lcdc.vram_phys = req_md->region[0].paddr;
lcdc.vram_size = req_md->region[0].size;
if ((r = mmap_kern()) < 0)
return r;
dev_dbg(lcdc.fbdev->dev, "vram at %08x size %08lx mapped to 0x%p\n",
lcdc.vram_phys, lcdc.vram_size, lcdc.vram_virt);
return 0;
}
static void cleanup_fbmem(void)
{
if (lcdc.fbmem_allocated)
free_fbmem();
else
unmap_kern();
} }
static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode,
...@@ -833,7 +770,7 @@ static void omap_lcdc_cleanup(void) ...@@ -833,7 +770,7 @@ static void omap_lcdc_cleanup(void)
{ {
if (!lcdc.ext_mode) if (!lcdc.ext_mode)
free_palette_ram(); free_palette_ram();
cleanup_fbmem(); free_fbmem();
omap_free_lcd_dma(); omap_free_lcd_dma();
free_irq(OMAP_LCDC_IRQ, lcdc.fbdev); free_irq(OMAP_LCDC_IRQ, lcdc.fbdev);
clk_disable(lcdc.lcd_ck); clk_disable(lcdc.lcd_ck);
......
...@@ -1823,6 +1823,7 @@ void omapfb_register_panel(struct lcd_panel *panel) ...@@ -1823,6 +1823,7 @@ void omapfb_register_panel(struct lcd_panel *panel)
if (fbdev_pdev != NULL) if (fbdev_pdev != NULL)
omapfb_do_probe(fbdev_pdev, fbdev_panel); omapfb_do_probe(fbdev_pdev, fbdev_panel);
} }
EXPORT_SYMBOL_GPL(omapfb_register_panel);
/* Called when the device is being detached from the driver */ /* Called when the device is being detached from the driver */
static int omapfb_remove(struct platform_device *pdev) static int omapfb_remove(struct platform_device *pdev)
......
...@@ -612,11 +612,9 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev) ...@@ -612,11 +612,9 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
/* handle IO resources */ /* handle IO resources */
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->mmio_base = devm_request_and_ioremap(dev, r); priv->mmio_base = devm_ioremap_resource(dev, r);
if (IS_ERR(priv->mmio_base)) { if (IS_ERR(priv->mmio_base))
dev_err(dev, "failed to map I/O memory\n");
return PTR_ERR(priv->mmio_base); return PTR_ERR(priv->mmio_base);
}
/* enable the clock */ /* enable the clock */
priv->clk = devm_clk_get(dev, NULL); priv->clk = devm_clk_get(dev, NULL);
......
...@@ -1401,9 +1401,10 @@ static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -1401,9 +1401,10 @@ static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
static void s3_pci_remove(struct pci_dev *dev) static void s3_pci_remove(struct pci_dev *dev)
{ {
struct fb_info *info = pci_get_drvdata(dev); struct fb_info *info = pci_get_drvdata(dev);
struct s3fb_info __maybe_unused *par = info->par; struct s3fb_info __maybe_unused *par;
if (info) { if (info) {
par = info->par;
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
if (par->mtrr_reg >= 0) { if (par->mtrr_reg >= 0) {
......
...@@ -162,7 +162,7 @@ static ssize_t contrast_show(struct device *dev, ...@@ -162,7 +162,7 @@ static ssize_t contrast_show(struct device *dev,
struct fb_info *info = dev_get_drvdata(dev); struct fb_info *info = dev_get_drvdata(dev);
struct wm8505fb_info *fbi = to_wm8505fb_info(info); struct wm8505fb_info *fbi = to_wm8505fb_info(info);
return sprintf(buf, "%d\n", fbi->contrast); return sprintf(buf, "%u\n", fbi->contrast);
} }
static ssize_t contrast_store(struct device *dev, static ssize_t contrast_store(struct device *dev,
......
...@@ -115,10 +115,8 @@ int of_get_display_timing(struct device_node *np, const char *name, ...@@ -115,10 +115,8 @@ int of_get_display_timing(struct device_node *np, const char *name,
{ {
struct device_node *timing_np; struct device_node *timing_np;
if (!np) { if (!np)
pr_err("%s: no devicenode given\n", of_node_full_name(np));
return -EINVAL; return -EINVAL;
}
timing_np = of_get_child_by_name(np, name); timing_np = of_get_child_by_name(np, name);
if (!timing_np) { if (!timing_np) {
...@@ -142,10 +140,8 @@ struct display_timings *of_get_display_timings(struct device_node *np) ...@@ -142,10 +140,8 @@ struct display_timings *of_get_display_timings(struct device_node *np)
struct device_node *native_mode; struct device_node *native_mode;
struct display_timings *disp; struct display_timings *disp;
if (!np) { if (!np)
pr_err("%s: no device node given\n", of_node_full_name(np));
return NULL; return NULL;
}
timings_np = of_get_child_by_name(np, "display-timings"); timings_np = of_get_child_by_name(np, "display-timings");
if (!timings_np) { if (!timings_np) {
...@@ -164,7 +160,7 @@ struct display_timings *of_get_display_timings(struct device_node *np) ...@@ -164,7 +160,7 @@ struct display_timings *of_get_display_timings(struct device_node *np)
entry = of_parse_phandle(timings_np, "native-mode", 0); entry = of_parse_phandle(timings_np, "native-mode", 0);
/* assume first child as native mode if none provided */ /* assume first child as native mode if none provided */
if (!entry) if (!entry)
entry = of_get_next_child(np, NULL); entry = of_get_next_child(timings_np, NULL);
/* if there is no child, it is useless to go on */ /* if there is no child, it is useless to go on */
if (!entry) { if (!entry) {
pr_err("%s: no timing specifications given\n", pr_err("%s: no timing specifications given\n",
......
...@@ -47,6 +47,7 @@ struct device_node; ...@@ -47,6 +47,7 @@ struct device_node;
#define FB_MISC_PRIM_COLOR 1 #define FB_MISC_PRIM_COLOR 1
#define FB_MISC_1ST_DETAIL 2 /* First Detailed Timing is preferred */ #define FB_MISC_1ST_DETAIL 2 /* First Detailed Timing is preferred */
#define FB_MISC_HDMI 4
struct fb_chroma { struct fb_chroma {
__u32 redx; /* in fraction of 1024 */ __u32 redx; /* in fraction of 1024 */
__u32 greenx; __u32 greenx;
...@@ -641,7 +642,7 @@ static inline void unlock_fb_info(struct fb_info *info) ...@@ -641,7 +642,7 @@ static inline void unlock_fb_info(struct fb_info *info)
static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
u8 *src, u32 s_pitch, u32 height) u8 *src, u32 s_pitch, u32 height)
{ {
int i, j; u32 i, j;
d_pitch -= s_pitch; d_pitch -= s_pitch;
......
...@@ -393,7 +393,7 @@ extern int omap_modify_dma_chain_params(int chain_id, ...@@ -393,7 +393,7 @@ extern int omap_modify_dma_chain_params(int chain_id,
extern int omap_dma_chain_status(int chain_id); extern int omap_dma_chain_status(int chain_id);
#endif #endif
#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP) #if defined(CONFIG_ARCH_OMAP1) && IS_ENABLED(CONFIG_FB_OMAP)
#include <mach/lcd_dma.h> #include <mach/lcd_dma.h>
#else #else
static inline int omap_lcd_dma_running(void) static inline int omap_lcd_dma_running(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment