]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'twl4030-mfd' into for-2.6.33
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 25 Nov 2009 14:25:36 +0000 (14:25 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 25 Nov 2009 14:25:36 +0000 (14:25 +0000)
1  2 
drivers/mfd/twl4030-core.c

index cc3f77bd76080d29dc69f4dc68a7639789017b2f,5049d04930254da57ec4e8ae4c0662542bc50a8c..98b984e191d5281c60377c4cc8321e898542fcae
@@@ -486,6 -486,7 +486,6 @@@ static in
  add_children(struct twl4030_platform_data *pdata, unsigned long features)
  {
        struct device   *child;
 -      struct device   *usb_transceiver = NULL;
  
        if (twl_has_bci() && pdata->bci && !(features & TPS_SUBSET)) {
                child = add_child(3, "twl4030_bci",
        }
  
        if (twl_has_usb() && pdata->usb) {
 +
 +              static struct regulator_consumer_supply usb1v5 = {
 +                      .supply =       "usb1v5",
 +              };
 +              static struct regulator_consumer_supply usb1v8 = {
 +                      .supply =       "usb1v8",
 +              };
 +              static struct regulator_consumer_supply usb3v1 = {
 +                      .supply =       "usb3v1",
 +              };
 +
 +      /* First add the regulators so that they can be used by transceiver */
 +              if (twl_has_regulator()) {
 +                      /* this is a template that gets copied */
 +                      struct regulator_init_data usb_fixed = {
 +                              .constraints.valid_modes_mask =
 +                                      REGULATOR_MODE_NORMAL
 +                                      | REGULATOR_MODE_STANDBY,
 +                              .constraints.valid_ops_mask =
 +                                      REGULATOR_CHANGE_MODE
 +                                      | REGULATOR_CHANGE_STATUS,
 +                      };
 +
 +                      child = add_regulator_linked(TWL4030_REG_VUSB1V5,
 +                                                    &usb_fixed, &usb1v5, 1);
 +                      if (IS_ERR(child))
 +                              return PTR_ERR(child);
 +
 +                      child = add_regulator_linked(TWL4030_REG_VUSB1V8,
 +                                                    &usb_fixed, &usb1v8, 1);
 +                      if (IS_ERR(child))
 +                              return PTR_ERR(child);
 +
 +                      child = add_regulator_linked(TWL4030_REG_VUSB3V1,
 +                                                    &usb_fixed, &usb3v1, 1);
 +                      if (IS_ERR(child))
 +                              return PTR_ERR(child);
 +
 +              }
 +
                child = add_child(0, "twl4030_usb",
                                pdata->usb, sizeof(*pdata->usb),
                                true,
                                /* irq0 = USB_PRES, irq1 = USB */
                                pdata->irq_base + 8 + 2, pdata->irq_base + 4);
 +
                if (IS_ERR(child))
                        return PTR_ERR(child);
  
                /* we need to connect regulators to this transceiver */
 -              usb_transceiver = child;
 +              if (twl_has_regulator() && child) {
 +                      usb1v5.dev = child;
 +                      usb1v8.dev = child;
 +                      usb3v1.dev = child;
 +              }
        }
  
        if (twl_has_watchdog()) {
                        return PTR_ERR(child);
        }
  
 -      if (twl_has_regulator() && usb_transceiver) {
 -              static struct regulator_consumer_supply usb1v5 = {
 -                      .supply =       "usb1v5",
 -              };
 -              static struct regulator_consumer_supply usb1v8 = {
 -                      .supply =       "usb1v8",
 -              };
 -              static struct regulator_consumer_supply usb3v1 = {
 -                      .supply =       "usb3v1",
 -              };
 -
 -              /* this is a template that gets copied */
 -              struct regulator_init_data usb_fixed = {
 -                      .constraints.valid_modes_mask =
 -                                REGULATOR_MODE_NORMAL
 -                              | REGULATOR_MODE_STANDBY,
 -                      .constraints.valid_ops_mask =
 -                                REGULATOR_CHANGE_MODE
 -                              | REGULATOR_CHANGE_STATUS,
 -              };
 -
 -              usb1v5.dev = usb_transceiver;
 -              usb1v8.dev = usb_transceiver;
 -              usb3v1.dev = usb_transceiver;
 -
 -              child = add_regulator_linked(TWL4030_REG_VUSB1V5, &usb_fixed,
 -                              &usb1v5, 1);
 -              if (IS_ERR(child))
 -                      return PTR_ERR(child);
 -
 -              child = add_regulator_linked(TWL4030_REG_VUSB1V8, &usb_fixed,
 -                              &usb1v8, 1);
 -              if (IS_ERR(child))
 -                      return PTR_ERR(child);
 -
 -              child = add_regulator_linked(TWL4030_REG_VUSB3V1, &usb_fixed,
 -                              &usb3v1, 1);
 -              if (IS_ERR(child))
 -                      return PTR_ERR(child);
 -      }
 -
        /* maybe add LDOs that are omitted on cost-reduced parts */
        if (twl_has_regulator() && !(features & TPS_SUBSET)) {
                child = add_regulator(TWL4030_REG_VPLL2, pdata->vpll2);
@@@ -777,7 -774,7 +777,7 @@@ static int twl4030_remove(struct i2c_cl
  }
  
  /* NOTE:  this driver only handles a single twl4030/tps659x0 chip */
- static int
+ static int __init
  twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id)
  {
        int                             status;
                        twl->client = i2c_new_dummy(client->adapter,
                                        twl->address);
                        if (!twl->client) {
 -                              dev_err(&twl->client->dev,
 +                              dev_err(&client->dev,
                                        "can't attach client %d\n", i);
                                status = -ENOMEM;
                                goto fail;