Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDMI driver cleanup and move irqchip driver to drivers/irqchip #17

Merged
merged 4 commits into from
Feb 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ config MACH_JZ4740
select ARCH_REQUIRE_GPIOLIB
select SYS_HAS_EARLY_PRINTK
select COMMON_CLK
select GENERIC_IRQ_CHIP
select JZ4740_IRQC
select BUILTIN_DTB
select USE_OF
select LIBFDT
Expand All @@ -265,7 +265,7 @@ config MACH_JZ4780
select PINCTRL
select PINCTRL_JZ4780
select SYS_SUPPORTS_HIGHMEM
select GENERIC_IRQ_CHIP
select JZ4740_IRQC
select BUILTIN_DTB
select USE_OF
select LIBFDT
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/jz4740/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Object file lists.

obj-y += prom.o irq.o time.o reset.o setup.o \
obj-y += prom.o time.o reset.o setup.o \
platform.o timer.o serial.o

obj-$(CONFIG_MACH_JZ4740) += gpio.o
Expand Down
14 changes: 7 additions & 7 deletions drivers/gpu/drm/jz4780/dwc_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,7 @@ void dwc_hdmi_register(struct dwc_hdmi *hdmi, struct drm_device *dev)
{
struct drm_encoder *encoder = &hdmi->encoder;
struct drm_connector *connector = &hdmi->connector;
int ret;

connector->funcs = &dwc_hdmi_connector_funcs;
encoder->funcs = &dwc_hdmi_encoder_funcs;
Expand All @@ -1603,13 +1604,12 @@ void dwc_hdmi_register(struct dwc_hdmi *hdmi, struct drm_device *dev)

connector->encoder = encoder;

int ret = drm_connector_register(connector);
if (ret) {
dev_err(dev,
"[CONNECTOR:%d:%s] drm_connector_register failed: %d\n",
connector->base.id,
connector->name, ret);
}
ret = drm_connector_register(connector);
if (ret) {
dev_err(dev->dev,
"[CONNECTOR:%d:%s] drm_connector_register failed: %d\n",
connector->base.id, connector->name, ret);
}

drm_mode_connector_attach_encoder(connector, encoder);

Expand Down
4 changes: 4 additions & 0 deletions drivers/irqchip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ config IMGPDC_IRQ
select GENERIC_IRQ_CHIP
select IRQ_DOMAIN

config JZ4740_IRQC
bool
select GENERIC_IRQ_CHIP

config CLPS711X_IRQCHIP
bool
depends on ARCH_CLPS711X
Expand Down
1 change: 1 addition & 0 deletions drivers/irqchip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ obj-$(CONFIG_IRQ_CROSSBAR) += irq-crossbar.o
obj-$(CONFIG_BRCMSTB_L2_IRQ) += irq-brcmstb-l2.o \
irq-bcm7120-l2.o
obj-$(CONFIG_KEYSTONE_IRQ) += irq-keystone.o
obj-$(CONFIG_JZ4740_IRQC) += irq-jz4740.o
24 changes: 15 additions & 9 deletions arch/mips/jz4740/irq.c → drivers/irqchip/irq-jz4740.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/timex.h>
#include <linux/slab.h>
Expand All @@ -28,9 +29,7 @@

#include <asm/io.h>

#include <asm/mach-jz4740/base.h>

#include "../../drivers/irqchip/irqchip.h"
#include "irqchip.h"

static void __iomem *jz_intc_base;
static unsigned jz_num_chips;
Expand All @@ -41,6 +40,7 @@ static unsigned jz_num_chips;
#define JZ_REG_INTC_CLEAR_MASK 0x0c
#define JZ_REG_INTC_PENDING 0x10
#define CHIP_SIZE 0x20
#define IRQ_BASE 8

static irqreturn_t jz4740_cascade(int irq, void *data)
{
Expand All @@ -52,7 +52,7 @@ static irqreturn_t jz4740_cascade(int irq, void *data)
if (!irq_reg)
continue;

generic_handle_irq(__fls(irq_reg) + (i * 32) + JZ4740_IRQ_BASE);
generic_handle_irq(__fls(irq_reg) + (i * 32) + IRQ_BASE);
}

return IRQ_HANDLED;
Expand Down Expand Up @@ -88,23 +88,29 @@ static int __init jz47xx_intc_of_init(struct device_node *node, unsigned num_chi
struct irq_chip_generic *gc;
struct irq_chip_type *ct;
struct irq_domain *domain;
int parent_irq;
struct resource res;
int ret, parent_irq;
unsigned i;

parent_irq = irq_of_parse_and_map(node, 0);
if (!parent_irq)
return -EINVAL;

ret = of_address_to_resource(node, 0, &res);
if (ret < 0)
return ret;

jz_num_chips = num_chips;
jz_intc_base = ioremap(JZ4740_INTC_BASE_ADDR,
jz_intc_base = ioremap(res.start,
((num_chips - 1) * CHIP_SIZE) + 0x14);

for (i = 0; i < num_chips; i++) {
/* Mask all irqs */
writel(0xffffffff, jz_intc_base + JZ_REG_INTC_SET_MASK);

gc = irq_alloc_generic_chip("INTC", 1, JZ4740_IRQ_BASE + (i * 32),
jz_intc_base + (i * CHIP_SIZE), handle_level_irq);
gc = irq_alloc_generic_chip("INTC", 1, IRQ_BASE + (i * 32),
jz_intc_base + (i * CHIP_SIZE),
handle_level_irq);

gc->wake_enabled = IRQ_MSK(32);

Expand All @@ -121,7 +127,7 @@ static int __init jz47xx_intc_of_init(struct device_node *node, unsigned num_chi
irq_setup_generic_chip(gc, IRQ_MSK(32), 0, 0, IRQ_NOPROBE | IRQ_LEVEL);
}

domain = irq_domain_add_legacy(node, num_chips * 32, JZ4740_IRQ_BASE, 0,
domain = irq_domain_add_legacy(node, num_chips * 32, IRQ_BASE, 0,
&irq_domain_simple_ops, NULL);
if (!domain)
pr_warn("unable to register IRQ domain\n");
Expand Down