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

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

Merge tag 'davinci-for-v5.1/soc-part3' of...

Merge tag 'davinci-for-v5.1/soc-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into arm/late

DaVinci SoC updates for v5.1 (part 3)
-------------------------------------
This pull request gets rid of mach-davinci private interrupt controller
implmentations (aintc and cp_initc) and moves them to drivers/irqchip.

mach/irqs.h usage outside of mach-davinci has been rid of.

The driver changes (input and irqchip) have been acked by respective
maintainers.

* tag 'davinci-for-v5.1/soc-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci

: (57 commits)
  ARM: davinci: remove intc related fields from davinci_soc_info
  irqchip: davinci-cp-intc: move the driver to drivers/irqchip
  ARM: davinci: cp-intc: remove redundant comments
  ARM: davinci: cp-intc: drop GPL license boilerplate
  ARM: davinci: cp-intc: use readl/writel_relaxed()
  ARM: davinci: cp-intc: unify error handling
  ARM: davinci: cp-intc: improve coding style
  ARM: davinci: cp-intc: request the memory region before remapping it
  ARM: davinci: cp-intc: use the new-style config structure
  ARM: davinci: cp-intc: convert all hex numbers to lowercase
  ARM: davinci: cp-intc: use a common prefix for all symbols
  ARM: davinci: cp-intc: add the new config structures for da8xx SoCs
  irqchip: davinci-cp-intc: add a new config structure
  ARM: davinci: cp-intc: add a wrapper around cp_intc_init()
  ARM: davinci: cp-intc: remove cp_intc.h
  irqchip: davinci-aintc: move the driver to drivers/irqchip
  ARM: davinci: aintc: remove unnecessary includes
  ARM: davinci: aintc: remove the timer-specific irq_set_handler()
  ARM: davinci: aintc: request memory region before remapping it
  ARM: davinci: aintc: unify error handling
  ...

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents f17b5f06 49b654fd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -589,11 +589,13 @@ config ARCH_DAVINCI
	select GENERIC_ALLOCATOR
	select GENERIC_CLOCKEVENTS
	select GENERIC_IRQ_CHIP
	select GENERIC_IRQ_MULTI_HANDLER
	select GPIOLIB
	select HAVE_IDE
	select PM_GENERIC_DOMAINS if PM
	select PM_GENERIC_DOMAINS_OF if PM && OF
	select RESET_CONTROLLER
	select SPARSE_IRQ
	select USE_OF
	select ZONE_DMA
	help
+6 −13
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
if ARCH_DAVINCI

config AINTC
	bool

config CP_INTC
	bool
	select IRQ_DOMAIN

config ARCH_DAVINCI_DMx
	bool

@@ -17,17 +10,17 @@ comment "DaVinci Core Type"

config ARCH_DAVINCI_DM644x
	bool "DaVinci 644x based system"
	select AINTC
	select DAVINCI_AINTC
	select ARCH_DAVINCI_DMx

config ARCH_DAVINCI_DM355
	bool "DaVinci 355 based system"
	select AINTC
	select DAVINCI_AINTC
	select ARCH_DAVINCI_DMx

config ARCH_DAVINCI_DM646x
	bool "DaVinci 646x based system"
	select AINTC
	select DAVINCI_AINTC
	select ARCH_DAVINCI_DMx

config ARCH_DAVINCI_DA830
@@ -36,20 +29,20 @@ config ARCH_DAVINCI_DA830
	select ARCH_DAVINCI_DA8XX
	# needed on silicon revs 1.0, 1.1:
	select CPU_DCACHE_WRITETHROUGH if !CPU_DCACHE_DISABLE
	select CP_INTC
	select DAVINCI_CP_INTC

config ARCH_DAVINCI_DA850
	bool "DA850/OMAP-L138/AM18x based system"
	depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
	select ARCH_DAVINCI_DA8XX
	select CP_INTC
	select DAVINCI_CP_INTC

config ARCH_DAVINCI_DA8XX
	bool

config ARCH_DAVINCI_DM365
	bool "DaVinci 365 based system"
	select AINTC
	select DAVINCI_AINTC
	select ARCH_DAVINCI_DMx

comment "DaVinci Board Type"
+0 −3
Original line number Diff line number Diff line
@@ -18,9 +18,6 @@ obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o
obj-$(CONFIG_ARCH_DAVINCI_DA830)	+= da830.o devices-da8xx.o usb-da8xx.o
obj-$(CONFIG_ARCH_DAVINCI_DA850)	+= da850.o devices-da8xx.o usb-da8xx.o

obj-$(CONFIG_AINTC)			+= irq.o
obj-$(CONFIG_CP_INTC)			+= cp_intc.o

# Board specific
obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o pdata-quirks.o
obj-$(CONFIG_MACH_DAVINCI_EVM)  	+= board-dm644x-evm.o
+4 −4
Original line number Diff line number Diff line
@@ -49,9 +49,9 @@
#define DAVINCI_DA830_DMA_MCASP2_AXEVT	5

/* Interrupts */
#define DAVINCI_ASP0_RX_INT	IRQ_MBRINT
#define DAVINCI_ASP0_TX_INT	IRQ_MBXINT
#define DAVINCI_ASP1_RX_INT	IRQ_MBRINT
#define DAVINCI_ASP1_TX_INT	IRQ_MBXINT
#define DAVINCI_ASP0_RX_INT	DAVINCI_INTC_IRQ(IRQ_MBRINT)
#define DAVINCI_ASP0_TX_INT	DAVINCI_INTC_IRQ(IRQ_MBXINT)
#define DAVINCI_ASP1_RX_INT	DAVINCI_INTC_IRQ(IRQ_MBRINT)
#define DAVINCI_ASP1_TX_INT	DAVINCI_INTC_IRQ(IRQ_MBXINT)

#endif /* __ASM_ARCH_DAVINCI_ASP_H */
+16 −75
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/platform_data/pcf857x.h>
#include <linux/platform_data/at24.h>
#include <linux/property.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/spi/spi.h>
@@ -36,10 +36,11 @@
#include <asm/mach/arch.h>

#include <mach/common.h>
#include "cp_intc.h"
#include <mach/mux.h>
#include <mach/da8xx.h>

#include "irqs.h"

#define DA830_EVM_PHY_ID		""
/*
 * USB1 VBUS is controlled by GPIO1[15], over-current is reported on GPIO2[4].
@@ -52,62 +53,19 @@ static const short da830_evm_usb11_pins[] = {
	-1
};

static da8xx_ocic_handler_t da830_evm_usb_ocic_handler;

static int da830_evm_usb_set_power(unsigned port, int on)
{
	gpio_set_value(ON_BD_USB_DRV, on);
	return 0;
}

static int da830_evm_usb_get_power(unsigned port)
{
	return gpio_get_value(ON_BD_USB_DRV);
}

static int da830_evm_usb_get_oci(unsigned port)
{
	return !gpio_get_value(ON_BD_USB_OVC);
}

static irqreturn_t da830_evm_usb_ocic_irq(int, void *);

static int da830_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
{
	int irq 	= gpio_to_irq(ON_BD_USB_OVC);
	int error	= 0;

	if (handler != NULL) {
		da830_evm_usb_ocic_handler = handler;

		error = request_irq(irq, da830_evm_usb_ocic_irq,
				    IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
				    "OHCI over-current indicator", NULL);
		if (error)
			pr_err("%s: could not request IRQ to watch over-current indicator changes\n",
			       __func__);
	} else
		free_irq(irq, NULL);

	return error;
}
static struct gpiod_lookup_table da830_evm_usb_gpio_lookup = {
	.dev_id		= "ohci-da8xx",
	.table = {
		GPIO_LOOKUP("davinci_gpio", ON_BD_USB_DRV, "vbus", 0),
		GPIO_LOOKUP("davinci_gpio", ON_BD_USB_OVC, "oc", 0),
	},
};

static struct da8xx_ohci_root_hub da830_evm_usb11_pdata = {
	.set_power	= da830_evm_usb_set_power,
	.get_power	= da830_evm_usb_get_power,
	.get_oci	= da830_evm_usb_get_oci,
	.ocic_notify	= da830_evm_usb_ocic_notify,

	/* TPS2065 switch @ 5V */
	.potpgt		= (3 + 1) / 2,	/* 3 ms max */
};

static irqreturn_t da830_evm_usb_ocic_irq(int irq, void *dev_id)
{
	da830_evm_usb_ocic_handler(&da830_evm_usb11_pdata, 1);
	return IRQ_HANDLED;
}

static __init void da830_evm_usb_init(void)
{
	int ret;
@@ -142,21 +100,7 @@ static __init void da830_evm_usb_init(void)
		return;
	}

	ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
	if (ret) {
		pr_err("%s: failed to request GPIO for USB 1.1 port power control: %d\n",
		       __func__, ret);
		return;
	}
	gpio_direction_output(ON_BD_USB_DRV, 0);

	ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
	if (ret) {
		pr_err("%s: failed to request GPIO for USB 1.1 port over-current indicator: %d\n",
		       __func__, ret);
		return;
	}
	gpio_direction_input(ON_BD_USB_OVC);
	gpiod_add_lookup_table(&da830_evm_usb_gpio_lookup);

	ret = da8xx_register_usb11(&da830_evm_usb11_pdata);
	if (ret)
@@ -457,12 +401,9 @@ static struct nvmem_cell_lookup da830_evm_nvmem_cell_lookup = {
	.con_id		= "mac-address",
};

static struct at24_platform_data da830_evm_i2c_eeprom_info = {
	.byte_len	= SZ_256K / 8,
	.page_size	= 64,
	.flags		= AT24_FLAG_ADDR16,
	.setup		= davinci_get_mac_addr,
	.context	= (void *)0x7f00,
static const struct property_entry da830_evm_i2c_eeprom_properties[] = {
	PROPERTY_ENTRY_U32("pagesize", 64),
	{ }
};

static int __init da830_evm_ui_expander_setup(struct i2c_client *client,
@@ -496,7 +437,7 @@ static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
static struct i2c_board_info __initdata da830_evm_i2c_devices[] = {
	{
		I2C_BOARD_INFO("24c256", 0x50),
		.platform_data	= &da830_evm_i2c_eeprom_info,
		.properties = da830_evm_i2c_eeprom_properties,
	},
	{
		I2C_BOARD_INFO("tlv320aic3x", 0x18),
@@ -693,7 +634,7 @@ static void __init da830_evm_map_io(void)
MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
	.atag_offset	= 0x100,
	.map_io		= da830_evm_map_io,
	.init_irq	= cp_intc_init,
	.init_irq	= da830_init_irq,
	.init_time	= da830_init_time,
	.init_machine	= da830_evm_init,
	.init_late	= davinci_init_late,
Loading