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

Commit 7fecc34e authored by Russell King's avatar Russell King Committed by Russell King
Browse files

Merge branch 'pxa-tosa' into pxa

Conflicts:

	arch/arm/mach-pxa/Kconfig
	arch/arm/mach-pxa/tosa.c
	arch/arm/mach-pxa/spitz.c
parents a9da4f7e 93887049
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -584,6 +584,8 @@ L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
S:	Maintained

ARM/TOSA MACHINE SUPPORT
P:	Dmitry Baryshkov
M:	dbaryshkov@gmail.com
P:	Dirk Opfer
M:	dirk@opfer-online.de
S:	Maintained
+9 −0
Original line number Diff line number Diff line
@@ -310,4 +310,13 @@ config PXA_PWM
	default BACKLIGHT_PWM
	help
	  Enable support for PXA2xx/PXA3xx PWM controllers

config TOSA_BT
	tristate "Control the state of built-in bluetooth chip on Sharp SL-6000"
	depends on MACH_TOSA
	select RFKILL
	help
	  This is a simple driver that is able to control
	  the state of built in bluetooth chip on tosa.

endif
+3 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

# Common support (must be linked before board specific support)
obj-y				+= clock.o devices.o generic.o irq.o dma.o \
				   time.o gpio.o
				   time.o gpio.o reset.o
obj-$(CONFIG_PM)		+= pm.o sleep.o standby.o
obj-$(CONFIG_CPU_FREQ)		+= cpu-pxa.o

@@ -61,3 +61,5 @@ obj-$(CONFIG_LEDS) += $(led-y)
ifeq ($(CONFIG_PCI),y)
obj-$(CONFIG_MACH_ARMCORE) += cm-x270-pci.o
endif

obj-$(CONFIG_TOSA_BT)		+= tosa-bt.o
+96 −0
Original line number Diff line number Diff line
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <asm/io.h>
#include <asm/proc-fns.h>

#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-regs.h>

static void do_hw_reset(void);

static int reset_gpio = -1;

int init_gpio_reset(int gpio)
{
	int rc;

	rc = gpio_request(gpio, "reset generator");
	if (rc) {
		printk(KERN_ERR "Can't request reset_gpio\n");
		goto out;
	}

	rc = gpio_direction_input(gpio);
	if (rc) {
		printk(KERN_ERR "Can't configure reset_gpio for input\n");
		gpio_free(gpio);
		goto out;
	}

out:
	if (!rc)
		reset_gpio = gpio;

	return rc;
}

/*
 * Trigger GPIO reset.
 * This covers various types of logic connecting gpio pin
 * to RESET pins (nRESET or GPIO_RESET):
 */
static void do_gpio_reset(void)
{
	BUG_ON(reset_gpio == -1);

	/* drive it low */
	gpio_direction_output(reset_gpio, 0);
	mdelay(2);
	/* rising edge or drive high */
	gpio_set_value(reset_gpio, 1);
	mdelay(2);
	/* falling edge */
	gpio_set_value(reset_gpio, 0);

	/* give it some time */
	mdelay(10);

	WARN_ON(1);
	/* fallback */
	do_hw_reset();
}

static void do_hw_reset(void)
{
	/* Initialize the watchdog and let it fire */
	OWER = OWER_WME;
	OSSR = OSSR_M3;
	OSMR3 = OSCR + 368640;	/* ... in 100 ms */
}

void arch_reset(char mode)
{
	if (cpu_is_pxa2xx())
		RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;

	switch (mode) {
	case 's':
		/* Jump into ROM at address 0 */
		cpu_reset(0);
		break;
	case 'h':
		do_hw_reset();
		break;
	case 'g':
		do_gpio_reset();
		break;
	}
}
+3 −5
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-regs.h>
#include <asm/arch/pxa2xx-gpio.h>
#include <asm/arch/pxa27x-udc.h>
#include <asm/arch/irda.h>
#include <asm/arch/mmc.h>
#include <asm/arch/ohci.h>
@@ -529,11 +530,7 @@ static struct platform_device *devices[] __initdata = {

static void spitz_poweroff(void)
{
	pxa_gpio_mode(SPITZ_GPIO_ON_RESET | GPIO_OUT);
	GPSR(SPITZ_GPIO_ON_RESET) = GPIO_bit(SPITZ_GPIO_ON_RESET);

	mdelay(1000);
	arm_machine_restart('h');
	arm_machine_restart('g');
}

static void spitz_restart(char mode)
@@ -547,6 +544,7 @@ static void spitz_restart(char mode)

static void __init common_init(void)
{
	init_gpio_reset(SPITZ_GPIO_ON_RESET);
	pm_power_off = spitz_poweroff;
	arm_pm_restart = spitz_restart;

Loading