]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge tag 'topic/twl' into regulator-next
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 19 Mar 2012 17:17:32 +0000 (17:17 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 19 Mar 2012 17:17:32 +0000 (17:17 +0000)
TWL specific changes, cross-merged with OMAP due to arch/arm wanting to
use the new ability to override the voltage set and get operations to
support the in-CPU voltage management.  The other changes are minor
fixes, the addition of a few new regulators and device tree support.

1  2 
drivers/mfd/twl-core.c

diff --combined drivers/mfd/twl-core.c
index c1e4f1a277e9abc5bf609b2a945cb22073ac3271,d3cf5e8c1d020998cb19841f888cccbc707536a1..6cb10610a1612532f539da00dae5db14aed96cb9
@@@ -263,9 -263,7 +263,9 @@@ struct twl_client 
  
  static struct twl_client twl_modules[TWL_NUM_SLAVES];
  
 +#ifdef CONFIG_IRQ_DOMAIN
  static struct irq_domain domain;
 +#endif
  
  /* mapping the module id to slave id and base address */
  struct twl_mapping {
@@@ -621,6 -619,8 +621,8 @@@ add_regulator_linked(int num, struct re
                unsigned num_consumers, unsigned long features)
  {
        unsigned sub_chip_id;
+       struct twl_regulator_driver_data drv_data;
        /* regulator framework demands init_data ... */
        if (!pdata)
                return NULL;
                pdata->num_consumer_supplies = num_consumers;
        }
  
-       pdata->driver_data = (void *)features;
+       if (pdata->driver_data) {
+               /* If we have existing drv_data, just add the flags */
+               struct twl_regulator_driver_data *tmp;
+               tmp = pdata->driver_data;
+               tmp->features |= features;
+       } else {
+               /* add new driver data struct, used only during init */
+               drv_data.features = features;
+               drv_data.set_voltage = NULL;
+               drv_data.get_voltage = NULL;
+               drv_data.data = NULL;
+               pdata->driver_data = &drv_data;
+       }
  
        /* NOTE:  we currently ignore regulator IRQs, e.g. for short circuits */
        sub_chip_id = twl_map[TWL_MODULE_PM_MASTER].sid;
@@@ -753,9 -765,9 +767,9 @@@ add_children(struct twl4030_platform_da
  
                /* we need to connect regulators to this transceiver */
                if (twl_has_regulator() && child) {
 -                      usb1v5.dev = child;
 -                      usb1v8.dev = child;
 -                      usb3v1.dev = child;
 +                      usb1v5.dev_name = dev_name(child);
 +                      usb1v8.dev_name = dev_name(child);
 +                      usb3v1.dev_name = dev_name(child);
                }
        }
        if (twl_has_usb() && pdata->usb && twl_class_is_6030()) {
                        return PTR_ERR(child);
                /* we need to connect regulators to this transceiver */
                if (twl_has_regulator() && child)
 -                      usb3v3.dev = child;
 +                      usb3v3.dev_name = dev_name(child);
        } else if (twl_has_regulator() && twl_class_is_6030()) {
                if (features & TWL6025_SUBCLASS)
                        child = add_regulator(TWL6025_REG_LDOUSB,
        /* twl6030 regulators */
        if (twl_has_regulator() && twl_class_is_6030() &&
                        !(features & TWL6025_SUBCLASS)) {
+               child = add_regulator(TWL6030_REG_VDD1, pdata->vdd1,
+                                       features);
+               if (IS_ERR(child))
+                       return PTR_ERR(child);
+               child = add_regulator(TWL6030_REG_VDD2, pdata->vdd2,
+                                       features);
+               if (IS_ERR(child))
+                       return PTR_ERR(child);
+               child = add_regulator(TWL6030_REG_VDD3, pdata->vdd3,
+                                       features);
+               if (IS_ERR(child))
+                       return PTR_ERR(child);
+               child = add_regulator(TWL6030_REG_V1V8, pdata->v1v8,
+                                       features);
+               if (IS_ERR(child))
+                       return PTR_ERR(child);
+               child = add_regulator(TWL6030_REG_V2V1, pdata->v2v1,
+                                       features);
+               if (IS_ERR(child))
+                       return PTR_ERR(child);
                child = add_regulator(TWL6030_REG_VMMC, pdata->vmmc,
                                        features);
                if (IS_ERR(child))
@@@ -1228,13 -1265,13 +1267,13 @@@ twl_probe(struct i2c_client *client, co
        pdata->irq_base = status;
        pdata->irq_end = pdata->irq_base + nr_irqs;
  
 +#ifdef CONFIG_IRQ_DOMAIN
        domain.irq_base = pdata->irq_base;
        domain.nr_irq = nr_irqs;
 -#ifdef CONFIG_OF_IRQ
        domain.of_node = of_node_get(node);
        domain.ops = &irq_domain_simple_ops;
 -#endif
        irq_domain_add(&domain);
 +#endif
  
        if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) {
                dev_dbg(&client->dev, "can't talk I2C?\n");