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

Commit e6fb383f authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'ep93xx-for-arm-soc-1' of...

Merge tag 'ep93xx-for-arm-soc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into next/soc

Pull "EP93xx improvements for v4.15"

EP93xx patches that have been floating for a while,
converting the platform to sparsemem, using SPI-MMC
and a bit more.

* tag 'ep93xx-for-arm-soc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
  ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards
  ARM: ep93xx: tidy up TS-72xx Watchdog resources
  ARM: ep93xx: simone: let the mmc_spi driver handle the card detect
  ARM: ep93xx: switch to SPARSEMEM
parents 8a5776a5 7aef828d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -378,7 +378,7 @@ config ARCH_EBSA110

config ARCH_EP93XX
	bool "EP93xx-based"
	select ARCH_HAS_HOLES_MEMORYMODEL
	select ARCH_SPARSEMEM_ENABLE
	select ARM_AMBA
	imply ARM_PATCH_PHYS_VIRT
	select ARM_VIC
+3 −51
Original line number Diff line number Diff line
@@ -43,60 +43,12 @@ static struct ep93xxfb_mach_info __initdata simone_fb_info = {
	.flags		= EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING,
};

/*
 * GPIO lines used for MMC card detection.
 */
#define MMC_CARD_DETECT_GPIO EP93XX_GPIO_LINE_EGPIO0

/*
 * MMC card detection GPIO setup.
 */

static int simone_mmc_spi_init(struct device *dev,
	irqreturn_t (*irq_handler)(int, void *), void *mmc)
{
	unsigned int gpio = MMC_CARD_DETECT_GPIO;
	int irq, err;

	err = gpio_request(gpio, dev_name(dev));
	if (err)
		return err;

	err = gpio_direction_input(gpio);
	if (err)
		goto fail;

	irq = gpio_to_irq(gpio);
	if (irq < 0)
		goto fail;

	err = request_irq(irq, irq_handler, IRQF_TRIGGER_FALLING,
			  "MMC card detect", mmc);
	if (err)
		goto fail;

	printk(KERN_INFO "%s: using irq %d for MMC card detection\n",
	       dev_name(dev), irq);

	return 0;
fail:
	gpio_free(gpio);
	return err;
}

static void simone_mmc_spi_exit(struct device *dev, void *mmc)
{
	unsigned int gpio = MMC_CARD_DETECT_GPIO;

	free_irq(gpio_to_irq(gpio), mmc);
	gpio_free(gpio);
}

static struct mmc_spi_platform_data simone_mmc_spi_data = {
	.init		= simone_mmc_spi_init,
	.exit		= simone_mmc_spi_exit,
	.detect_delay	= 500,
	.ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
	.flags		= MMC_SPI_USE_CD_GPIO,
	.cd_gpio	= EP93XX_GPIO_LINE_EGPIO0,
	.cd_debounce	= 1,
};

static struct spi_board_info simone_spi_devices[] __initdata = {
+35 −11
Original line number Diff line number Diff line
@@ -18,7 +18,10 @@
#include <linux/io.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
#include <linux/spi/spi.h>
#include <linux/platform_data/spi-ep93xx.h>

#include <mach/gpio-ep93xx.h>
#include <mach/hardware.h>

#include <asm/mach-types.h>
@@ -186,24 +189,22 @@ static struct platform_device ts72xx_rtc_device = {
	.num_resources 	= ARRAY_SIZE(ts72xx_rtc_resources),
};

/*************************************************************************
 * Watchdog (in CPLD)
 *************************************************************************/
#define TS72XX_WDT_CONTROL_PHYS_BASE	(EP93XX_CS2_PHYS_BASE + 0x03800000)
#define TS72XX_WDT_FEED_PHYS_BASE	(EP93XX_CS2_PHYS_BASE + 0x03c00000)

static struct resource ts72xx_wdt_resources[] = {
	{
		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
		.flags	= IORESOURCE_MEM,
	},
	{
		.start	= TS72XX_WDT_FEED_PHYS_BASE,
		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
		.flags	= IORESOURCE_MEM,
	},
	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, 0x01),
	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, 0x01),
};

static struct platform_device ts72xx_wdt_device = {
	.name		= "ts72xx-wdt",
	.id		= -1,
	.num_resources 	= ARRAY_SIZE(ts72xx_wdt_resources),
	.resource	= ts72xx_wdt_resources,
	.num_resources	= ARRAY_SIZE(ts72xx_wdt_resources),
};

static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
@@ -232,6 +233,27 @@ static struct platform_device ts73xx_fpga_device = {

#endif

/*************************************************************************
 * SPI Bus
 *************************************************************************/
static struct spi_board_info ts72xx_spi_devices[] __initdata = {
	{
		.modalias		= "tmp122",
		.max_speed_hz		= 2 * 1000 * 1000,
		.bus_num		= 0,
		.chip_select		= 0,
	},
};

static int ts72xx_spi_chipselects[] __initdata = {
	EP93XX_GPIO_LINE_F(2),		/* DIO_17 */
};

static struct ep93xx_spi_info ts72xx_spi_info __initdata = {
	.chipselect	= ts72xx_spi_chipselects,
	.num_chipselect	= ARRAY_SIZE(ts72xx_spi_chipselects),
};

static void __init ts72xx_init_machine(void)
{
	ep93xx_init_devices();
@@ -244,6 +266,8 @@ static void __init ts72xx_init_machine(void)
	if (board_is_ts7300())
		platform_device_register(&ts73xx_fpga_device);
#endif
	ep93xx_register_spi(&ts72xx_spi_info, ts72xx_spi_devices,
			    ARRAY_SIZE(ts72xx_spi_devices));
}

MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
+0 −3
Original line number Diff line number Diff line
@@ -38,9 +38,6 @@
#define TS72XX_OPTIONS2_TS9420		0x04
#define TS72XX_OPTIONS2_TS9420_BOOT	0x02

#define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
#define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000

#ifndef __ASSEMBLY__

static inline int ts72xx_model(void)