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

Commit bd1f7936 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt
Browse files

Merge commit 'gcl/gcl-next' into next

parents 30aae739 ff82c587
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -56,12 +56,12 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id)
	int dev_match = 0;
	int id_match = 0;

	if (dev == NULL && id == NULL)
	if (dev == NULL || id == NULL)
		return NULL;

	mutex_lock(&clocks_mutex);
	list_for_each_entry(p, &clocks, node) {
		if (dev && dev == p->dev)
		if (dev == p->dev)
			dev_match++;
		if (strcmp(id, p->name) == 0)
			id_match++;
+0 −3
Original line number Diff line number Diff line
@@ -363,11 +363,8 @@ static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio)
{
	struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
	struct mpc52xx_gpt __iomem *regs = mm_gc->regs;
	unsigned int ret;

	return (in_be32(&regs->status) & (1 << (31 - 23))) ? 1 : 0;

	return ret;
}

static void
+7 −1
Original line number Diff line number Diff line
@@ -196,6 +196,7 @@ static void mpc52xx_extirq_ack(unsigned int virq)

static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
{
	struct irq_desc *desc = get_irq_desc(virq);
	u32 ctrl_reg, type;
	int irq;
	int l2irq;
@@ -222,6 +223,11 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
		type = 0;
	}

	desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
	desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
	if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
		desc->status |= IRQ_LEVEL;

	ctrl_reg = in_be32(&intr->ctrl);
	ctrl_reg &= ~(0x3 << (22 - (l2irq * 2)));
	ctrl_reg |= (type << (22 - (l2irq * 2)));
@@ -231,7 +237,7 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
}

static struct irq_chip mpc52xx_extirq_irqchip = {
	.typename = " MPC52xx IRQ[0-3] ",
	.typename = "MPC52xx External",
	.mask = mpc52xx_extirq_mask,
	.unmask = mpc52xx_extirq_unmask,
	.ack = mpc52xx_extirq_ack,
+1 −0
Original line number Diff line number Diff line
@@ -1206,6 +1206,7 @@ static struct of_device_id ace_of_match[] __devinitdata = {
	{ .compatible = "xlnx,opb-sysace-1.00.b", },
	{ .compatible = "xlnx,opb-sysace-1.00.c", },
	{ .compatible = "xlnx,xps-sysace-1.00.a", },
	{ .compatible = "xlnx,sysace", },
	{},
};
MODULE_DEVICE_TABLE(of, ace_of_match);
+19 −0
Original line number Diff line number Diff line
@@ -66,4 +66,23 @@ void of_register_i2c_devices(struct i2c_adapter *adap,
}
EXPORT_SYMBOL(of_register_i2c_devices);

static int of_dev_node_match(struct device *dev, void *data)
{
        return dev_archdata_get_node(&dev->archdata) == data;
}

/* must call put_device() when done with returned i2c_client device */
struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
{
	struct device *dev;

	dev = bus_find_device(&i2c_bus_type, NULL, node,
					 of_dev_node_match);
	if (!dev)
		return NULL;

	return to_i2c_client(dev);
}
EXPORT_SYMBOL(of_find_i2c_device_by_node);

MODULE_LICENSE("GPL");
Loading