~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/regulator/ab3100.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include <linux/platform_device.h>
18
18
#include <linux/regulator/driver.h>
19
19
#include <linux/mfd/abx500.h>
 
20
#include <linux/mfd/core.h>
20
21
 
21
22
/* LDO registers and some handy masking definitions for AB3100 */
22
23
#define AB3100_LDO_A            0x40
205
206
                return err;
206
207
        }
207
208
 
208
 
        /* Per-regulator power on delay from spec */
209
 
        switch (abreg->regreg) {
210
 
        case AB3100_LDO_A: /* Fallthrough */
211
 
        case AB3100_LDO_C: /* Fallthrough */
212
 
        case AB3100_LDO_D: /* Fallthrough */
213
 
        case AB3100_LDO_E: /* Fallthrough */
214
 
        case AB3100_LDO_H: /* Fallthrough */
215
 
        case AB3100_LDO_K:
216
 
                udelay(200);
217
 
                break;
218
 
        case AB3100_LDO_F:
219
 
                udelay(600);
220
 
                break;
221
 
        case AB3100_LDO_G:
222
 
                udelay(400);
223
 
                break;
224
 
        case AB3100_BUCK:
225
 
                mdelay(1);
226
 
                break;
227
 
        default:
228
 
                break;
229
 
        }
230
 
 
231
209
        return 0;
232
210
}
233
211
 
449
427
        return abreg->plfdata->external_voltage;
450
428
}
451
429
 
 
430
static int ab3100_enable_time_regulator(struct regulator_dev *reg)
 
431
{
 
432
        struct ab3100_regulator *abreg = reg->reg_data;
 
433
 
 
434
        /* Per-regulator power on delay from spec */
 
435
        switch (abreg->regreg) {
 
436
        case AB3100_LDO_A: /* Fallthrough */
 
437
        case AB3100_LDO_C: /* Fallthrough */
 
438
        case AB3100_LDO_D: /* Fallthrough */
 
439
        case AB3100_LDO_E: /* Fallthrough */
 
440
        case AB3100_LDO_H: /* Fallthrough */
 
441
        case AB3100_LDO_K:
 
442
                return 200;
 
443
        case AB3100_LDO_F:
 
444
                return 600;
 
445
        case AB3100_LDO_G:
 
446
                return 400;
 
447
        case AB3100_BUCK:
 
448
                return 1000;
 
449
        default:
 
450
                break;
 
451
        }
 
452
        return 0;
 
453
}
 
454
 
452
455
static struct regulator_ops regulator_ops_fixed = {
453
456
        .enable      = ab3100_enable_regulator,
454
457
        .disable     = ab3100_disable_regulator,
455
458
        .is_enabled  = ab3100_is_enabled_regulator,
456
459
        .get_voltage = ab3100_get_voltage_regulator,
 
460
        .enable_time = ab3100_enable_time_regulator,
457
461
};
458
462
 
459
463
static struct regulator_ops regulator_ops_variable = {
463
467
        .get_voltage = ab3100_get_voltage_regulator,
464
468
        .set_voltage = ab3100_set_voltage_regulator,
465
469
        .list_voltage = ab3100_list_voltage_regulator,
 
470
        .enable_time = ab3100_enable_time_regulator,
466
471
};
467
472
 
468
473
static struct regulator_ops regulator_ops_variable_sleepable = {
473
478
        .set_voltage = ab3100_set_voltage_regulator,
474
479
        .set_suspend_voltage = ab3100_set_suspend_voltage_regulator,
475
480
        .list_voltage = ab3100_list_voltage_regulator,
 
481
        .enable_time = ab3100_enable_time_regulator,
476
482
};
477
483
 
478
484
/*
576
582
 
577
583
static int __devinit ab3100_regulators_probe(struct platform_device *pdev)
578
584
{
579
 
        struct ab3100_platform_data *plfdata = pdev->dev.platform_data;
 
585
        struct ab3100_platform_data *plfdata = mfd_get_data(pdev);
580
586
        int err = 0;
581
587
        u8 data;
582
588
        int i;