static int __init s5p64x0_gpiolib_init(void)
{
	s5p64x0_gpiolib_set_cfg(s5p64x0_gpio_cfgs,
				ARRAY_SIZE(s5p64x0_gpio_cfgs));

	if (soc_is_s5p6450()) {
		samsung_gpiolib_add_2bit_chips(s5p6450_gpio_2bit,
					ARRAY_SIZE(s5p6450_gpio_2bit));

		samsung_gpiolib_add_4bit_chips(s5p6450_gpio_4bit,
					ARRAY_SIZE(s5p6450_gpio_4bit));

		samsung_gpiolib_add_4bit2_chips(s5p6450_gpio_4bit2,
					ARRAY_SIZE(s5p6450_gpio_4bit2));

		s5p64x0_gpio_add_rbank_4bit2(s5p6450_gpio_rbank_4bit2,
					ARRAY_SIZE(s5p6450_gpio_rbank_4bit2));
	} else {
		samsung_gpiolib_add_2bit_chips(s5p6440_gpio_2bit,
					ARRAY_SIZE(s5p6440_gpio_2bit));

		samsung_gpiolib_add_4bit_chips(s5p6440_gpio_4bit,
					ARRAY_SIZE(s5p6440_gpio_4bit));

		samsung_gpiolib_add_4bit2_chips(s5p6440_gpio_4bit2,
					ARRAY_SIZE(s5p6440_gpio_4bit2));

		s5p64x0_gpio_add_rbank_4bit2(s5p6440_gpio_rbank_4bit2,
					ARRAY_SIZE(s5p6440_gpio_rbank_4bit2));
	}

	return 0;
}
int s3c64xx_spi1_cfg_gpio(struct platform_device *dev)
{
	if (soc_is_s5p6450())
		s3c_gpio_cfgall_range(S5P6450_GPC(4), 3,
					S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
	else
		s3c_gpio_cfgall_range(S5P6440_GPC(4), 3,
					S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
	return 0;
}
void s5p64x0_fb_gpio_setup_24bpp(void)
{
	if (soc_is_s5p6440()) {
		s3c_gpio_cfgrange_nopull(S5P6440_GPI(0), 16, S3C_GPIO_SFN(2));
		s3c_gpio_cfgrange_nopull(S5P6440_GPJ(0), 12, S3C_GPIO_SFN(2));
	} else if (soc_is_s5p6450()) {
		s3c_gpio_cfgrange_nopull(S5P6450_GPI(0), 16, S3C_GPIO_SFN(2));
		s3c_gpio_cfgrange_nopull(S5P6450_GPJ(0), 12, S3C_GPIO_SFN(2));
	}
}
void s5p64x0_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
{
	struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;

	/*                                                       */
	if (soc_is_s5p6450())
		s3c_gpio_cfgrange_nopull(S5P6450_GPH(0), 2, S3C_GPIO_SFN(2));
	else
		s3c_gpio_cfgrange_nopull(S5P6440_GPH(0), 2 , S3C_GPIO_SFN(2));

	switch (width) {
	case 8:
		/*                                           */
		if (soc_is_s5p6450())
			s3c_gpio_cfgrange_nopull(S5P6450_GPH(6), 4,
						 S3C_GPIO_SFN(2));
		else
			s3c_gpio_cfgrange_nopull(S5P6440_GPH(6), 4,
						 S3C_GPIO_SFN(2));
	case 4:
		/*                                           */
		if (soc_is_s5p6450())
			s3c_gpio_cfgrange_nopull(S5P6450_GPH(2), 4,
						 S3C_GPIO_SFN(2));
		else
			s3c_gpio_cfgrange_nopull(S5P6440_GPH(2), 4,
						 S3C_GPIO_SFN(2));
	default:
		break;
	}

	/*                                                */
	if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
		if (soc_is_s5p6450()) {
			s3c_gpio_setpull(S5P6450_GPG(6), S3C_GPIO_PULL_UP);
			s3c_gpio_cfgpin(S5P6450_GPG(6), S3C_GPIO_SFN(3));
		} else {
			s3c_gpio_setpull(S5P6440_GPG(6), S3C_GPIO_PULL_UP);
			s3c_gpio_cfgpin(S5P6440_GPG(6), S3C_GPIO_SFN(3));
		}
	}
}
Esempio n. 5
0
File: dma.c Progetto: 08opt/linux
static int __init s5p64x0_dma_init(void)
{
	if (soc_is_s5p6450())
		s5p64x0_device_pdma.dev.platform_data = &s5p6450_pdma_pdata;
	else
		s5p64x0_device_pdma.dev.platform_data = &s5p6440_pdma_pdata;

	amba_device_register(&s5p64x0_device_pdma, &iomem_resource);

	return 0;
}
void s5p64x0_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
{
	struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;

	/*                                                      */
	if (soc_is_s5p6450())
		s3c_gpio_cfgrange_nopull(S5P6450_GPG(0), 2 + width,
					 S3C_GPIO_SFN(2));
	else
		s3c_gpio_cfgrange_nopull(S5P6440_GPG(0), 2 + width,
					 S3C_GPIO_SFN(2));

	/*                                                 */
	if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
		if (soc_is_s5p6450()) {
			s3c_gpio_setpull(S5P6450_GPG(6), S3C_GPIO_PULL_UP);
			s3c_gpio_cfgpin(S5P6450_GPG(6), S3C_GPIO_SFN(2));
		} else {
			s3c_gpio_setpull(S5P6440_GPG(6), S3C_GPIO_PULL_UP);
			s3c_gpio_cfgpin(S5P6440_GPG(6), S3C_GPIO_SFN(2));
		}
	}
}
Esempio n. 7
0
static int s5p64x0_irq_eint_set_type(struct irq_data *data, unsigned int type)
{
	int offs = eint_offset(data->irq);
	int shift;
	u32 ctrl, mask;
	u32 newvalue = 0;

	if (offs > 15)
		return -EINVAL;

	switch (type) {
	case IRQ_TYPE_NONE:
		printk(KERN_WARNING "No edge setting!\n");
		break;
	case IRQ_TYPE_EDGE_RISING:
		newvalue = S3C2410_EXTINT_RISEEDGE;
		break;
	case IRQ_TYPE_EDGE_FALLING:
		newvalue = S3C2410_EXTINT_FALLEDGE;
		break;
	case IRQ_TYPE_EDGE_BOTH:
		newvalue = S3C2410_EXTINT_BOTHEDGE;
		break;
	case IRQ_TYPE_LEVEL_LOW:
		newvalue = S3C2410_EXTINT_LOWLEV;
		break;
	case IRQ_TYPE_LEVEL_HIGH:
		newvalue = S3C2410_EXTINT_HILEV;
		break;
	default:
		printk(KERN_ERR "No such irq type %d", type);
		return -EINVAL;
	}

	shift = (offs / 2) * 4;
	mask = 0x7 << shift;

	ctrl = __raw_readl(S5P64X0_EINT0CON0) & ~mask;
	ctrl |= newvalue << shift;
	__raw_writel(ctrl, S5P64X0_EINT0CON0);

	/* Configure the GPIO pin for 6450 or 6440 based on CPU ID */
	if (soc_is_s5p6450())
		s3c_gpio_cfgpin(S5P6450_GPN(offs), S3C_GPIO_SFN(2));
	else
		s3c_gpio_cfgpin(S5P6440_GPN(offs), S3C_GPIO_SFN(2));

	return 0;
}
Esempio n. 8
0
static int __init s5p64x0_dma_init(void)
{
	if (soc_is_s5p6450()) {
		dma_cap_set(DMA_SLAVE, s5p6450_pdma_pdata.cap_mask);
		dma_cap_set(DMA_CYCLIC, s5p6450_pdma_pdata.cap_mask);
		s5p64x0_pdma_device.dev.platform_data = &s5p6450_pdma_pdata;
	} else {
		dma_cap_set(DMA_SLAVE, s5p6440_pdma_pdata.cap_mask);
		dma_cap_set(DMA_CYCLIC, s5p6440_pdma_pdata.cap_mask);
		s5p64x0_pdma_device.dev.platform_data = &s5p6440_pdma_pdata;
	}

	amba_device_register(&s5p64x0_pdma_device, &iomem_resource);

	return 0;
}