|  | @@ -164,3 +164,104 @@ static struct resource sh_mmcif_resources[] = {
 | 
	
		
			
				|  |  |  		.flags	= IORESOURCE_MEM,
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	[1] = {
 | 
	
		
			
				|  |  | +		.start	= gic_spi(141),
 | 
	
		
			
				|  |  | +		.flags	= IORESOURCE_IRQ,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +	[2] = {
 | 
	
		
			
				|  |  | +		.start	= gic_spi(140),
 | 
	
		
			
				|  |  | +		.flags	= IORESOURCE_IRQ,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct sh_mmcif_plat_data sh_mmcif_platdata = {
 | 
	
		
			
				|  |  | +	.sup_pclk	= 0,
 | 
	
		
			
				|  |  | +	.ocr		= MMC_VDD_165_195,
 | 
	
		
			
				|  |  | +	.caps		= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
 | 
	
		
			
				|  |  | +	.slave_id_tx	= SHDMA_SLAVE_MMCIF_TX,
 | 
	
		
			
				|  |  | +	.slave_id_rx	= SHDMA_SLAVE_MMCIF_RX,
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct platform_device mmc_device = {
 | 
	
		
			
				|  |  | +	.name		= "sh_mmcif",
 | 
	
		
			
				|  |  | +	.id		= 0,
 | 
	
		
			
				|  |  | +	.dev		= {
 | 
	
		
			
				|  |  | +		.dma_mask		= NULL,
 | 
	
		
			
				|  |  | +		.coherent_dma_mask	= 0xffffffff,
 | 
	
		
			
				|  |  | +		.platform_data		= &sh_mmcif_platdata,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +	.num_resources	= ARRAY_SIZE(sh_mmcif_resources),
 | 
	
		
			
				|  |  | +	.resource	= sh_mmcif_resources,
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* IrDA */
 | 
	
		
			
				|  |  | +static struct resource irda_resources[] = {
 | 
	
		
			
				|  |  | +	[0] = {
 | 
	
		
			
				|  |  | +		.start	= 0xE6D00000,
 | 
	
		
			
				|  |  | +		.end	= 0xE6D01FD4 - 1,
 | 
	
		
			
				|  |  | +		.flags  = IORESOURCE_MEM,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +	[1] = {
 | 
	
		
			
				|  |  | +		.start	= gic_spi(95),
 | 
	
		
			
				|  |  | +		.flags  = IORESOURCE_IRQ,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct platform_device irda_device = {
 | 
	
		
			
				|  |  | +	.name           = "sh_irda",
 | 
	
		
			
				|  |  | +	.id		= 0,
 | 
	
		
			
				|  |  | +	.resource       = irda_resources,
 | 
	
		
			
				|  |  | +	.num_resources  = ARRAY_SIZE(irda_resources),
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* MIPI-DSI */
 | 
	
		
			
				|  |  | +static struct resource mipidsi0_resources[] = {
 | 
	
		
			
				|  |  | +	[0] = {
 | 
	
		
			
				|  |  | +		.name	= "DSI0",
 | 
	
		
			
				|  |  | +		.start  = 0xfeab0000,
 | 
	
		
			
				|  |  | +		.end    = 0xfeab3fff,
 | 
	
		
			
				|  |  | +		.flags  = IORESOURCE_MEM,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +	[1] = {
 | 
	
		
			
				|  |  | +		.name	= "DSI0",
 | 
	
		
			
				|  |  | +		.start  = 0xfeab4000,
 | 
	
		
			
				|  |  | +		.end    = 0xfeab7fff,
 | 
	
		
			
				|  |  | +		.flags  = IORESOURCE_MEM,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static int sh_mipi_set_dot_clock(struct platform_device *pdev,
 | 
	
		
			
				|  |  | +				 void __iomem *base,
 | 
	
		
			
				|  |  | +				 int enable)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	struct clk *pck, *phy;
 | 
	
		
			
				|  |  | +	int ret;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	pck = clk_get(&pdev->dev, "dsip_clk");
 | 
	
		
			
				|  |  | +	if (IS_ERR(pck)) {
 | 
	
		
			
				|  |  | +		ret = PTR_ERR(pck);
 | 
	
		
			
				|  |  | +		goto sh_mipi_set_dot_clock_pck_err;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	phy = clk_get(&pdev->dev, "dsiphy_clk");
 | 
	
		
			
				|  |  | +	if (IS_ERR(phy)) {
 | 
	
		
			
				|  |  | +		ret = PTR_ERR(phy);
 | 
	
		
			
				|  |  | +		goto sh_mipi_set_dot_clock_phy_err;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if (enable) {
 | 
	
		
			
				|  |  | +		clk_set_rate(pck, clk_round_rate(pck,  24000000));
 | 
	
		
			
				|  |  | +		clk_set_rate(phy, clk_round_rate(pck, 510000000));
 | 
	
		
			
				|  |  | +		clk_enable(pck);
 | 
	
		
			
				|  |  | +		clk_enable(phy);
 | 
	
		
			
				|  |  | +	} else {
 | 
	
		
			
				|  |  | +		clk_disable(pck);
 | 
	
		
			
				|  |  | +		clk_disable(phy);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	ret = 0;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	clk_put(phy);
 | 
	
		
			
				|  |  | +sh_mipi_set_dot_clock_phy_err:
 | 
	
		
			
				|  |  | +	clk_put(pck);
 | 
	
		
			
				|  |  | +sh_mipi_set_dot_clock_pck_err:
 | 
	
		
			
				|  |  | +	return ret;
 |