Commit 4238973b authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge tag 'omap-for-v4.21/omap1-signed' of...

Merge tag 'omap-for-v4.21/omap1-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc

Changes for omap1 variants for v4.21 merge window

In this set of changes Aaro Koskinen revives Palm Tungsten E for the
MMC and USB making it usable again. And Janusz Krzysztofik follows up
on the clean-up of  ams-delta GPIO handling. The other changes are
clean-up for DEFINE_SHOW_ATTRIBUTE by Yangtao Li.

* tag 'omap-for-v4.21/omap1-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap

:
  ARM: OMAP1: fix USB configuration for device-only setups
  ARM: OMAP1: add MMC configuration for Palm Tungsten E
  ARM: OMAP1: devices: configure omap1_spi100k only on OMAP7xx
  ARM: OMAP1/2: fix SoC name printing
  ARM: OMAP1: ams-delta: Move AMS_DELTA_LATCH2_NGPIO to the board file
  ARM: OMAP1: ams-delta: Drop unused symbols from the board header
  ARM: OMAP1: ams-delta: Drop board specific global GPIO numbers
  ARM: OMAP: PM: Change to use DEFINE_SHOW_ATTRIBUTE macro
  ARM: OMAP1: clock: Change to use DEFINE_SHOW_ATTRIBUTE macro
  ARM: OMAP1: ams-delta: Provide GPIO lookup table for LED device
  ARM: OMAP1: ams-delta: make board header file local to mach-omap1

Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 4dd201be 5a87809b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ obj-y += $(i2c-omap-m) $(i2c-omap-y)

led-y := leds.o

usb-fs-$(CONFIG_USB)			:= usb.o
usb-fs-$(CONFIG_USB_SUPPORT)		:= usb.o
obj-y					+= $(usb-fs-m) $(usb-fs-y)

# Specific board support
+1 −1
Original line number Diff line number Diff line
@@ -18,9 +18,9 @@
#include <linux/platform_data/gpio-omap.h>

#include <asm/assembler.h>
#include <mach/board-ams-delta.h>

#include "ams-delta-fiq.h"
#include "board-ams-delta.h"
#include "iomap.h"
#include "soc.h"

+1 −2
Original line number Diff line number Diff line
@@ -22,11 +22,10 @@
#include <linux/platform_data/ams-delta-fiq.h>
#include <linux/platform_device.h>

#include <mach/board-ams-delta.h>

#include <asm/fiq.h>

#include "ams-delta-fiq.h"
#include "board-ams-delta.h"

static struct fiq_handler fh = {
	.name	= "ams-delta-fiq"
+31 −75
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>

#include <mach/board-ams-delta.h>
#include <linux/platform_data/keypad-omap.h>
#include <mach/mux.h>

@@ -45,6 +44,7 @@
#include <mach/usb.h>

#include "ams-delta-fiq.h"
#include "board-ams-delta.h"
#include "iomap.h"
#include "common.h"

@@ -167,7 +167,6 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
	.pins[0]	= 2,
};

#define LATCH1_GPIO_BASE	232
#define LATCH1_NGPIO		8

static struct resource latch1_resources[] = {
@@ -183,7 +182,6 @@ static struct resource latch1_resources[] = {

static struct bgpio_pdata latch1_pdata = {
	.label	= LATCH1_LABEL,
	.base	= LATCH1_GPIO_BASE,
	.ngpio	= LATCH1_NGPIO,
};

@@ -206,11 +204,13 @@ static struct platform_device latch1_gpio_device = {
#define LATCH1_PIN_DOCKIT1		6
#define LATCH1_PIN_DOCKIT2		7

#define LATCH2_NGPIO			16

static struct resource latch2_resources[] = {
	[0] = {
		.name	= "dat",
		.start	= LATCH2_PHYS,
		.end	= LATCH2_PHYS + (AMS_DELTA_LATCH2_NGPIO - 1) / 8,
		.end	= LATCH2_PHYS + (LATCH2_NGPIO - 1) / 8,
		.flags	= IORESOURCE_MEM,
	},
};
@@ -219,8 +219,7 @@ static struct resource latch2_resources[] = {

static struct bgpio_pdata latch2_pdata = {
	.label	= LATCH2_LABEL,
	.base	= AMS_DELTA_LATCH2_GPIO_BASE,
	.ngpio	= AMS_DELTA_LATCH2_NGPIO,
	.ngpio	= LATCH2_NGPIO,
};

static struct platform_device latch2_gpio_device = {
@@ -371,15 +370,9 @@ static struct gpiod_lookup_table ams_delta_lcd_gpio_table = {
	},
};

/*
 * Dynamically allocated GPIO numbers must be obtained fromm GPIO device
 * before they can be put in the gpio_led table.  Before that happens,
 * initialize the table with invalid GPIO numbers, not 0.
 */
static struct gpio_led gpio_leds[] __initdata = {
	[LATCH1_PIN_LED_CAMERA] = {
		.name		 = "camera",
		.gpio		 = -EINVAL,
		.default_state	 = LEDS_GPIO_DEFSTATE_OFF,
#ifdef CONFIG_LEDS_TRIGGERS
		.default_trigger = "ams_delta_camera",
@@ -387,27 +380,22 @@ static struct gpio_led gpio_leds[] __initdata = {
	},
	[LATCH1_PIN_LED_ADVERT] = {
		.name		 = "advert",
		.gpio		 = -EINVAL,
		.default_state	 = LEDS_GPIO_DEFSTATE_OFF,
	},
	[LATCH1_PIN_LED_MAIL] = {
		.name		 = "email",
		.gpio		 = -EINVAL,
		.default_state	 = LEDS_GPIO_DEFSTATE_OFF,
	},
	[LATCH1_PIN_LED_HANDSFREE] = {
		.name		 = "handsfree",
		.gpio		 = -EINVAL,
		.default_state	 = LEDS_GPIO_DEFSTATE_OFF,
	},
	[LATCH1_PIN_LED_VOICEMAIL] = {
		.name		 = "voicemail",
		.gpio		 = -EINVAL,
		.default_state	 = LEDS_GPIO_DEFSTATE_OFF,
	},
	[LATCH1_PIN_LED_VOICE] = {
		.name		 = "voice",
		.gpio		 = -EINVAL,
		.default_state	 = LEDS_GPIO_DEFSTATE_OFF,
	},
};
@@ -417,6 +405,24 @@ static const struct gpio_led_platform_data leds_pdata __initconst = {
	.num_leds	= ARRAY_SIZE(gpio_leds),
};

static struct gpiod_lookup_table leds_gpio_table = {
	.table = {
		GPIO_LOOKUP_IDX(LATCH1_LABEL, LATCH1_PIN_LED_CAMERA, NULL,
				LATCH1_PIN_LED_CAMERA, 0),
		GPIO_LOOKUP_IDX(LATCH1_LABEL, LATCH1_PIN_LED_ADVERT, NULL,
				LATCH1_PIN_LED_ADVERT, 0),
		GPIO_LOOKUP_IDX(LATCH1_LABEL, LATCH1_PIN_LED_MAIL, NULL,
				LATCH1_PIN_LED_MAIL, 0),
		GPIO_LOOKUP_IDX(LATCH1_LABEL, LATCH1_PIN_LED_HANDSFREE, NULL,
				LATCH1_PIN_LED_HANDSFREE, 0),
		GPIO_LOOKUP_IDX(LATCH1_LABEL, LATCH1_PIN_LED_VOICEMAIL, NULL,
				LATCH1_PIN_LED_VOICEMAIL, 0),
		GPIO_LOOKUP_IDX(LATCH1_LABEL, LATCH1_PIN_LED_VOICE, NULL,
				LATCH1_PIN_LED_VOICE, 0),
		{ },
	},
};

static struct i2c_board_info ams_delta_camera_board_info[] = {
	{
		I2C_BOARD_INFO("ov6650", 0x60),
@@ -677,6 +683,8 @@ static void __init ams_delta_latch2_init(void)

static void __init ams_delta_init(void)
{
	struct platform_device *leds_pdev;

	/* mux pins for uarts */
	omap_cfg_reg(UART1_TX);
	omap_cfg_reg(UART1_RTS);
@@ -740,6 +748,12 @@ static void __init ams_delta_init(void)
	gpiod_add_lookup_tables(ams_delta_gpio_tables,
				ARRAY_SIZE(ams_delta_gpio_tables));

	leds_pdev = gpio_led_register_device(PLATFORM_DEVID_NONE, &leds_pdata);
	if (!IS_ERR(leds_pdev)) {
		leds_gpio_table.dev_id = dev_name(&leds_pdev->dev);
		gpiod_add_lookup_table(&leds_gpio_table);
	}

	omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1);

	omapfb_set_lcd_config(&ams_delta_lcd_config);
@@ -793,64 +807,6 @@ static struct platform_device ams_delta_modem_device = {
	},
};

/*
 * leds-gpio driver doesn't make use of GPIO lookup tables,
 * it has to be provided with GPIO numbers over platform data
 * if GPIO descriptor info can't be obtained from device tree.
 * We could either define GPIO lookup tables and use them on behalf
 * of the leds-gpio device, or we can use GPIO driver level methods
 * for identification of GPIO numbers as long as we don't support
 * device tree.  Let's do the latter.
 */
static void __init ams_delta_led_init(struct gpio_chip *chip)
{
	struct gpio_desc *gpiod;
	int i;

	for (i = LATCH1_PIN_LED_CAMERA; i < LATCH1_PIN_DOCKIT1; i++) {
		gpiod = gpiochip_request_own_desc(chip, i, NULL);
		if (IS_ERR(gpiod)) {
			pr_warn("%s: %s GPIO %d request failed (%ld)\n",
				__func__, LATCH1_LABEL, i, PTR_ERR(gpiod));
			continue;
		}

		/* Assign GPIO numbers to LED device. */
		gpio_leds[i].gpio = desc_to_gpio(gpiod);

		gpiochip_free_own_desc(gpiod);
	}

	gpio_led_register_device(PLATFORM_DEVID_NONE, &leds_pdata);
}

/*
 * The purpose of this function is to take care of assignment of GPIO numbers
 * to platform devices which depend on GPIO lines provided by Amstrad Delta
 * latch1 and/or latch2 GPIO devices but don't use GPIO lookup tables.
 * The function may be called as soon as latch1/latch2 GPIO devices are
 * initilized.  Since basic-mmio-gpio driver is not registered before
 * device_initcall, this may happen at erliest during device_initcall_sync.
 * Dependent devices shouldn't be registered before that, their
 * registration may be performed from within this function or later.
 */
static int __init ams_delta_gpio_init(void)
{
	struct gpio_chip *chip;

	if (!machine_is_ams_delta())
		return -ENODEV;

	chip = gpiochip_find(LATCH1_LABEL, gpiochip_match_by_label);
	if (!chip)
		pr_err("%s: latch1 GPIO chip not found\n", __func__);
	else
		ams_delta_led_init(chip);

	return 0;
}
device_initcall_sync(ams_delta_gpio_init);

static int __init modem_nreset_init(void)
{
	int err;
+1 −23
Original line number Diff line number Diff line
/*
 * arch/arm/plat-omap/include/mach/board-ams-delta.h
 * arch/arm/mach-omap1/board-ams-delta.h
 *
 * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
 *
@@ -28,10 +28,6 @@

#if defined (CONFIG_MACH_AMS_DELTA)

#define AMD_DELTA_LATCH2_SCARD_RSTIN	0x0400
#define AMD_DELTA_LATCH2_SCARD_CMDVCC	0x0800
#define AMS_DELTA_LATCH2_MODEM_CODEC	0x2000

#define AMS_DELTA_GPIO_PIN_KEYBRD_DATA	0
#define AMS_DELTA_GPIO_PIN_KEYBRD_CLK	1
#define AMS_DELTA_GPIO_PIN_MODEM_IRQ	2
@@ -41,24 +37,6 @@
#define AMS_DELTA_GPIO_PIN_CONFIG	11
#define AMS_DELTA_GPIO_PIN_NAND_RB	12

#define AMS_DELTA_GPIO_PIN_LCD_VBLEN		240
#define AMS_DELTA_GPIO_PIN_LCD_NDISP		241
#define AMS_DELTA_GPIO_PIN_NAND_NCE		242
#define AMS_DELTA_GPIO_PIN_NAND_NRE		243
#define AMS_DELTA_GPIO_PIN_NAND_NWP		244
#define AMS_DELTA_GPIO_PIN_NAND_NWE		245
#define AMS_DELTA_GPIO_PIN_NAND_ALE		246
#define AMS_DELTA_GPIO_PIN_NAND_CLE		247
#define AMS_DELTA_GPIO_PIN_KEYBRD_PWR		248
#define AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT	249
#define AMS_DELTA_GPIO_PIN_SCARD_RSTIN		250
#define AMS_DELTA_GPIO_PIN_SCARD_CMDVCC		251
#define AMS_DELTA_GPIO_PIN_MODEM_NRESET		252
#define AMS_DELTA_GPIO_PIN_MODEM_CODEC		253

#define AMS_DELTA_LATCH2_GPIO_BASE	AMS_DELTA_GPIO_PIN_LCD_VBLEN
#define AMS_DELTA_LATCH2_NGPIO		16

#endif /* CONFIG_MACH_AMS_DELTA */

#endif /* __ASM_ARCH_OMAP_AMS_DELTA_H */
Loading