Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7886e8aa authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus-sa1100' of git://git.armlinux.org.uk/~rmk/linux-arm

Pull ARM SA1100 updates from Russell King:
 "We have support for arbitary MMIO registers providing platform GPIOs,
  which allows us to abstract some of the SA11x0 CF support.

  This set of updates makes that change"

* 'for-linus-sa1100' of git://git.armlinux.org.uk/~rmk/linux-arm:
  ARM: sa1100/simpad: switch simpad CF to use gpiod APIs
  ARM: sa1100/shannon: convert to generic CF sockets
  ARM: sa1100/nanoengine: convert to generic CF sockets
  ARM: sa1100/h3xxx: switch h3xxx PCMCIA to use gpiod APIs
  ARM: sa1100/cerf: convert to generic CF sockets
  ARM: sa1100/assabet: convert to generic CF sockets
  ARM: sa1100: provide infrastructure to support generic CF sockets
  pcmcia: sa1100: provide generic CF support
parents 4a1e0052 64b2f129
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@ config SA1100_ASSABET
	bool "Assabet"
	select ARM_SA1110_CPUFREQ
	select GPIO_REG
	select REGULATOR
	select REGULATOR_FIXED_VOLTAGE
	help
	  Say Y here if you are using the Intel(R) StrongARM(R) SA-1110
	  Microprocessor Development Board (also known as the Assabet).
@@ -137,6 +139,8 @@ config SA1100_PLEB
config SA1100_SHANNON
	bool "Shannon"
	select ARM_SA1100_CPUFREQ
	select REGULATOR
	select REGULATOR_FIXED_VOLTAGE
	help
	  The Shannon (also known as a Tuxscreen, and also as a IS2630) was a
	  limited edition webphone produced by Philips. The Shannon is a SA1100
+38 −1
Original line number Diff line number Diff line
@@ -14,8 +14,11 @@
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/gpio/gpio-reg.h>
#include <linux/gpio/machine.h>
#include <linux/ioport.h>
#include <linux/platform_data/sa11x0-serial.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/serial_core.h>
#include <linux/platform_device.h>
#include <linux/mfd/ucb1x00.h>
@@ -445,6 +448,29 @@ static struct resource neponset_resources[] = {
};
#endif

static struct gpiod_lookup_table assabet_cf_gpio_table = {
	.dev_id = "sa11x0-pcmcia.1",
	.table = {
		GPIO_LOOKUP("gpio", 21, "ready", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("gpio", 22, "detect", GPIO_ACTIVE_LOW),
		GPIO_LOOKUP("gpio", 24, "bvd2", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("gpio", 25, "bvd1", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("assabet", 1, "reset", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("assabet", 7, "bus-enable", GPIO_ACTIVE_LOW),
		{ },
	},
};

static struct regulator_consumer_supply assabet_cf_vcc_consumers[] = {
	REGULATOR_SUPPLY("vcc", "sa11x0-pcmcia.1"),
};

static struct fixed_voltage_config assabet_cf_vcc_pdata __initdata = {
	.supply_name = "cf-power",
	.microvolts = 3300000,
	.enable_high = 1,
};

static void __init assabet_init(void)
{
	/*
@@ -490,6 +516,11 @@ static void __init assabet_init(void)
		platform_device_register_simple("neponset", 0,
			neponset_resources, ARRAY_SIZE(neponset_resources));
#endif
	} else {
		sa11x0_register_fixed_regulator(0, &assabet_cf_vcc_pdata,
					 assabet_cf_vcc_consumers,
					 ARRAY_SIZE(assabet_cf_vcc_consumers));

	}

#ifndef ASSABET_PAL_VIDEO
@@ -501,6 +532,9 @@ static void __init assabet_init(void)
			    ARRAY_SIZE(assabet_flash_resources));
	sa11x0_register_irda(&assabet_irda_data);
	sa11x0_register_mcp(&assabet_mcp_data);

	if (!machine_has_neponset())
		sa11x0_register_pcmcia(1, &assabet_cf_gpio_table);
}

/*
@@ -768,6 +802,7 @@ fs_initcall(assabet_leds_init);

void __init assabet_init_irq(void)
{
	unsigned int assabet_gpio_base;
	u32 def_val;

	sa1100_init_irq();
@@ -782,7 +817,9 @@ void __init assabet_init_irq(void)
	 *
	 * This must precede any driver calls to BCR_set() or BCR_clear().
	 */
	assabet_init_gpio((void *)&ASSABET_BCR, def_val);
	assabet_gpio_base = assabet_init_gpio((void *)&ASSABET_BCR, def_val);

	assabet_cf_vcc_pdata.gpio = assabet_gpio_base + 0;
}

MACHINE_START(ASSABET, "Intel-Assabet")
+15 −3
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
 */

#include <linux/init.h>
#include <linux/gpio/machine.h>
#include <linux/kernel.h>
#include <linux/tty.h>
#include <linux/platform_data/sa11x0-serial.h>
@@ -45,6 +46,19 @@ static struct platform_device cerfuart2_device = {
	.resource	= cerfuart2_resources,
};

/* Compact Flash */
static struct gpiod_lookup_table cerf_cf_gpio_table = {
	.dev_id = "sa11x0-pcmcia.1",
	.table = {
		GPIO_LOOKUP("gpio", 19, "bvd2", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("gpio", 20, "bvd1", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("gpio", 21, "reset", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("gpio", 22, "ready", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("gpio", 23, "detect", GPIO_ACTIVE_LOW),
		{ },
	},
};

/* LEDs */
struct gpio_led cerf_gpio_leds[] = {
	{
@@ -151,9 +165,6 @@ static void __init cerf_map_io(void)
	sa1100_register_uart(0, 3);
	sa1100_register_uart(1, 2); /* disable this and the uart2 device for sa1100_fir */
	sa1100_register_uart(2, 1);

	/* set some GPDR bits here while it's safe */
	GPDR |= CERF_GPIO_CF_RESET;
}

static struct mcp_plat_data cerf_mcp_data = {
@@ -167,6 +178,7 @@ static void __init cerf_init(void)
	platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
	sa11x0_register_mtd(&cerf_flash_data, &cerf_flash_resource, 1);
	sa11x0_register_mcp(&cerf_mcp_data);
	sa11x0_register_pcmcia(1, &cerf_cf_gpio_table);
}

MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
+2 −0
Original line number Diff line number Diff line
@@ -163,6 +163,8 @@ static struct clk_lookup sa11xx_clkregs[] = {
	CLKDEV_INIT("sa1100-rtc", NULL, NULL),
	CLKDEV_INIT("sa11x0-fb", NULL, &clk_cpu),
	CLKDEV_INIT("sa11x0-pcmcia", NULL, &clk_cpu),
	CLKDEV_INIT("sa11x0-pcmcia.0", NULL, &clk_cpu),
	CLKDEV_INIT("sa11x0-pcmcia.1", NULL, &clk_cpu),
	/* sa1111 names devices using internal offsets, PCMCIA is at 0x1800 */
	CLKDEV_INIT("1800", NULL, &clk_cpu),
	CLKDEV_INIT(NULL, "OSTIMER0", &clk_36864),
+43 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
 * published by the Free Software Foundation.
 */
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -20,6 +21,8 @@
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/irqchip/irq-sa11x0.h>

#include <video/sa1100fb.h>
@@ -232,11 +235,20 @@ void sa11x0_register_lcd(struct sa1100fb_mach_info *inf)
	sa11x0_register_device(&sa11x0fb_device, inf);
}

static bool sa11x0pcmcia_legacy = true;
static struct platform_device sa11x0pcmcia_device = {
	.name		= "sa11x0-pcmcia",
	.id		= -1,
};

void sa11x0_register_pcmcia(int socket, struct gpiod_lookup_table *table)
{
	if (table)
		gpiod_add_lookup_table(table);
	platform_device_register_simple("sa11x0-pcmcia", socket, NULL, 0);
	sa11x0pcmcia_legacy = false;
}

static struct platform_device sa11x0mtd_device = {
	.name		= "sa1100-mtd",
	.id		= -1,
@@ -311,7 +323,6 @@ static struct platform_device *sa11x0_devices[] __initdata = {
	&sa11x0uart1_device,
	&sa11x0uart3_device,
	&sa11x0ssp_device,
	&sa11x0pcmcia_device,
	&sa11x0rtc_device,
	&sa11x0dma_device,
};
@@ -319,6 +330,12 @@ static struct platform_device *sa11x0_devices[] __initdata = {
static int __init sa1100_init(void)
{
	pm_power_off = sa1100_power_off;

	if (sa11x0pcmcia_legacy)
		platform_device_register(&sa11x0pcmcia_device);

	regulator_has_full_constraints();

	return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices));
}

@@ -329,6 +346,31 @@ void __init sa11x0_init_late(void)
	sa11x0_pm_init();
}

int __init sa11x0_register_fixed_regulator(int n,
	struct fixed_voltage_config *cfg,
	struct regulator_consumer_supply *supplies, unsigned num_supplies)
{
	struct regulator_init_data *id;

	cfg->init_data = id = kzalloc(sizeof(*cfg->init_data), GFP_KERNEL);
	if (!cfg->init_data)
		return -ENOMEM;

	if (cfg->gpio < 0)
		id->constraints.always_on = 1;
	id->constraints.name = cfg->supply_name;
	id->constraints.min_uV = cfg->microvolts;
	id->constraints.max_uV = cfg->microvolts;
	id->constraints.valid_modes_mask = REGULATOR_MODE_NORMAL;
	id->constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS;
	id->consumer_supplies = supplies;
	id->num_consumer_supplies = num_supplies;

	platform_device_register_resndata(NULL, "reg-fixed-voltage", n,
					  NULL, 0, cfg, sizeof(*cfg));
	return 0;
}

/*
 * Common I/O mapping:
 *
Loading