Commit 622f8061 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'sh/for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  serial: sh-sci: fix sci interrupt handler
  video: hitfb: Move over to dev_pm_ops.
  video: hitfb: Convert to framebuffer_alloc().
  video: sh_mobile_lcdcfb: Convert to framebuffer_alloc().
  sh: add r8a66597 usb0 host to the se7724 board
  usb: allow sh7724 to enable on-chip r8a66597
  sh-sci: update receive error handling for muxed irqs
  sh: define PERF_COUNTER_INDEX_OFFSET.
parents 6c96895e dd4da3a5
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/smc91x.h>
#include <linux/gpio.h>
#include <linux/input.h>
#include <linux/usb/r8a66597.h>
#include <video/sh_mobile_lcdc.h>
#include <media/sh_mobile_ceu.h>
#include <asm/io.h>
@@ -302,6 +303,34 @@ static struct platform_device sh_eth_device = {
	.resource = sh_eth_resources,
};

static struct r8a66597_platdata sh7724_usb0_host_data = {
};

static struct resource sh7724_usb0_host_resources[] = {
	[0] = {
		.start	= 0xa4d80000,
		.end	= 0xa4d800ff,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= 65,
		.end	= 65,
		.flags	= IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
	},
};

static struct platform_device sh7724_usb0_host_device = {
	.name		= "r8a66597_hcd",
	.id		= 0,
	.dev = {
		.dma_mask		= NULL,         /*  not use dma */
		.coherent_dma_mask	= 0xffffffff,
		.platform_data		= &sh7724_usb0_host_data,
	},
	.num_resources	= ARRAY_SIZE(sh7724_usb0_host_resources),
	.resource	= sh7724_usb0_host_resources,
};

static struct platform_device *ms7724se_devices[] __initdata = {
	&heartbeat_device,
	&smc91x_eth_device,
@@ -311,6 +340,7 @@ static struct platform_device *ms7724se_devices[] __initdata = {
	&ceu1_device,
	&keysc_device,
	&sh_eth_device,
	&sh7724_usb0_host_device,
};

#define EEPROM_OP   0xBA206000
@@ -364,6 +394,7 @@ static void __init sh_eth_init(void)
#define SW4140    0xBA201000
#define FPGA_OUT  0xBA200400
#define PORT_HIZA 0xA4050158
#define PORT_MSELCRB 0xA4050182

#define SW41_A    0x0100
#define SW41_B    0x0200
@@ -373,6 +404,7 @@ static void __init sh_eth_init(void)
#define SW41_F    0x2000
#define SW41_G    0x4000
#define SW41_H    0x8000

static int __init devices_setup(void)
{
	u16 sw = ctrl_inw(SW4140); /* select camera, monitor */
@@ -385,6 +417,12 @@ static int __init devices_setup(void)
		    (1 << 14)), /* RMII */
		  FPGA_OUT);

	/* turn on USB clocks, use external clock */
	ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);

	/* enable USB0 port */
	ctrl_outw(0x0600, 0xa40501d4);

	/* enable IRQ 0,1,2 */
	gpio_request(GPIO_FN_INTC_IRQ0, NULL);
	gpio_request(GPIO_FN_INTC_IRQ1, NULL);
+2 −0
Original line number Diff line number Diff line
@@ -4,4 +4,6 @@
/* SH only supports software counters through this interface. */
static inline void set_perf_counter_pending(void) {}

#define PERF_COUNTER_INDEX_OFFSET	0

#endif /* __ASM_SH_PERF_COUNTER_H */
+6 −5
Original line number Diff line number Diff line
@@ -707,24 +707,25 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr)

static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
{
	unsigned short ssr_status, scr_status;
	unsigned short ssr_status, scr_status, err_enabled;
	struct uart_port *port = ptr;
	irqreturn_t ret = IRQ_NONE;

	ssr_status = sci_in(port, SCxSR);
	scr_status = sci_in(port, SCSCR);
	err_enabled = scr_status & (SCI_CTRL_FLAGS_REIE | SCI_CTRL_FLAGS_RIE);

	/* Tx Interrupt */
	if ((ssr_status & 0x0020) && (scr_status & SCI_CTRL_FLAGS_TIE))
	if ((ssr_status & SCxSR_TDxE(port)) && (scr_status & SCI_CTRL_FLAGS_TIE))
		ret = sci_tx_interrupt(irq, ptr);
	/* Rx Interrupt */
	if ((ssr_status & 0x0002) && (scr_status & SCI_CTRL_FLAGS_RIE))
	if ((ssr_status & SCxSR_RDxF(port)) && (scr_status & SCI_CTRL_FLAGS_RIE))
		ret = sci_rx_interrupt(irq, ptr);
	/* Error Interrupt */
	if ((ssr_status & 0x0080) && (scr_status & SCI_CTRL_FLAGS_REIE))
	if ((ssr_status & SCxSR_ERRORS(port)) && err_enabled)
		ret = sci_er_interrupt(irq, ptr);
	/* Break Interrupt */
	if ((ssr_status & 0x0010) && (scr_status & SCI_CTRL_FLAGS_REIE))
	if ((ssr_status & SCxSR_BRK(port)) && err_enabled)
		ret = sci_br_interrupt(irq, ptr);

	return ret;
+2 −2
Original line number Diff line number Diff line
@@ -337,10 +337,10 @@ config USB_R8A66597_HCD

config SUPERH_ON_CHIP_R8A66597
	boolean "Enable SuperH on-chip R8A66597 USB"
	depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723)
	depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723 || CPU_SUBTYPE_SH7724)
	help
	   This driver enables support for the on-chip R8A66597 in the
	   SH7366 and SH7723 processors.
	   SH7366, SH7723 and SH7724 processors.

config USB_WHCI_HCD
	tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)"
+44 −22
Original line number Diff line number Diff line
@@ -44,9 +44,6 @@ static struct fb_fix_screeninfo hitfb_fix __initdata = {
	.accel		= FB_ACCEL_NONE,
};

static u32 pseudo_palette[16];
static struct fb_info fb_info;

static inline void hitfb_accel_wait(void)
{
	while (fb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) ;
@@ -331,6 +328,8 @@ static struct fb_ops hitfb_ops = {
static int __init hitfb_probe(struct platform_device *dev)
{
	unsigned short lcdclor, ldr3, ldvndr;
	struct fb_info *info;
	int ret;

	if (fb_get_options("hitfb", NULL))
		return -ENODEV;
@@ -384,32 +383,53 @@ static int __init hitfb_probe(struct platform_device *dev)
		break;
	}

	fb_info.fbops = &hitfb_ops;
	fb_info.var = hitfb_var;
	fb_info.fix = hitfb_fix;
	fb_info.pseudo_palette = pseudo_palette;
	fb_info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN |
	info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev);
	if (unlikely(!info))
		return -ENOMEM;

	info->fbops = &hitfb_ops;
	info->var = hitfb_var;
	info->fix = hitfb_fix;
	info->pseudo_palette = info->par;
	info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN |
		FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA;

	fb_info.screen_base = (void *)hitfb_fix.smem_start;
	info->screen_base = (void *)hitfb_fix.smem_start;

	fb_alloc_cmap(&fb_info.cmap, 256, 0);
	ret = fb_alloc_cmap(&info->cmap, 256, 0);
	if (unlikely(ret < 0))
		goto err_fb;

	if (register_framebuffer(&fb_info) < 0)
		return -EINVAL;
	ret = register_framebuffer(info);
	if (unlikely(ret < 0))
		goto err;

	platform_set_drvdata(dev, info);

	printk(KERN_INFO "fb%d: %s frame buffer device\n",
	       fb_info.node, fb_info.fix.id);
	       info->node, info->fix.id);

	return 0;

err:
	fb_dealloc_cmap(&info->cmap);
err_fb:
	framebuffer_release(info);
	return ret;
}

static int __exit hitfb_remove(struct platform_device *dev)
{
	return unregister_framebuffer(&fb_info);
	struct fb_info *info = platform_get_drvdata(dev);

	unregister_framebuffer(info);
	fb_dealloc_cmap(&info->cmap);
	framebuffer_release(info);

	return 0;
}

#ifdef CONFIG_PM
static int hitfb_suspend(struct platform_device *dev, pm_message_t state)
static int hitfb_suspend(struct device *dev)
{
	u16 v;

@@ -421,7 +441,7 @@ static int hitfb_suspend(struct platform_device *dev, pm_message_t state)
	return 0;
}

static int hitfb_resume(struct platform_device *dev)
static int hitfb_resume(struct device *dev)
{
	u16 v;

@@ -435,17 +455,19 @@ static int hitfb_resume(struct platform_device *dev)

	return 0;
}
#endif

static struct dev_pm_ops hitfb_dev_pm_ops = {
	.suspend	= hitfb_suspend,
	.resume		= hitfb_resume,
};

static struct platform_driver hitfb_driver = {
	.probe		= hitfb_probe,
	.remove		= __exit_p(hitfb_remove),
#ifdef CONFIG_PM
	.suspend	= hitfb_suspend,
	.resume		= hitfb_resume,
#endif
	.driver		= {
		.name	= "hitfb",
		.owner	= THIS_MODULE,
		.pm	= &hitfb_dev_pm_ops,
	},
};

Loading