linux/include/linux/mfd/da9063/pdata.h
<<
>>
Prefs
   1/*
   2 * Platform configuration options for DA9063
   3 *
   4 * Copyright 2012 Dialog Semiconductor Ltd.
   5 *
   6 * Author: Michal Hajduk, Dialog Semiconductor
   7 * Author: Krystian Garbaciak, Dialog Semiconductor
   8 *
   9 *  This program is free software; you can redistribute  it and/or modify it
  10 *  under  the terms of  the GNU General  Public License as published by the
  11 *  Free Software Foundation;  either version 2 of the  License, or (at your
  12 *  option) any later version.
  13 *
  14 */
  15
  16#ifndef __MFD_DA9063_PDATA_H__
  17#define __MFD_DA9063_PDATA_H__
  18
  19#include <linux/regulator/machine.h>
  20
  21/*
  22 * Regulator configuration
  23 */
  24/* DA9063 regulator IDs */
  25enum {
  26        /* BUCKs */
  27        DA9063_ID_BCORE1,
  28        DA9063_ID_BCORE2,
  29        DA9063_ID_BPRO,
  30        DA9063_ID_BMEM,
  31        DA9063_ID_BIO,
  32        DA9063_ID_BPERI,
  33
  34        /* BCORE1 and BCORE2 in merged mode */
  35        DA9063_ID_BCORES_MERGED,
  36        /* BMEM and BIO in merged mode */
  37        DA9063_ID_BMEM_BIO_MERGED,
  38        /* When two BUCKs are merged, they cannot be reused separately */
  39
  40        /* LDOs */
  41        DA9063_ID_LDO1,
  42        DA9063_ID_LDO2,
  43        DA9063_ID_LDO3,
  44        DA9063_ID_LDO4,
  45        DA9063_ID_LDO5,
  46        DA9063_ID_LDO6,
  47        DA9063_ID_LDO7,
  48        DA9063_ID_LDO8,
  49        DA9063_ID_LDO9,
  50        DA9063_ID_LDO10,
  51        DA9063_ID_LDO11,
  52};
  53
  54/* Regulators platform data */
  55struct da9063_regulator_data {
  56        int                             id;
  57        struct regulator_init_data      *initdata;
  58};
  59
  60struct da9063_regulators_pdata {
  61        unsigned                        n_regulators;
  62        struct da9063_regulator_data    *regulator_data;
  63};
  64
  65
  66/*
  67 * RGB LED configuration
  68 */
  69/* LED IDs for flags in struct led_info. */
  70enum {
  71        DA9063_GPIO11_LED,
  72        DA9063_GPIO14_LED,
  73        DA9063_GPIO15_LED,
  74
  75        DA9063_LED_NUM
  76};
  77#define DA9063_LED_ID_MASK              0x3
  78
  79/* LED polarity for flags in struct led_info. */
  80#define DA9063_LED_HIGH_LEVEL_ACTIVE    0x0
  81#define DA9063_LED_LOW_LEVEL_ACTIVE     0x4
  82
  83
  84/*
  85 * General PMIC configuration
  86 */
  87/* HWMON ADC channels configuration */
  88#define DA9063_FLG_FORCE_IN0_MANUAL_MODE        0x0010
  89#define DA9063_FLG_FORCE_IN0_AUTO_MODE          0x0020
  90#define DA9063_FLG_FORCE_IN1_MANUAL_MODE        0x0040
  91#define DA9063_FLG_FORCE_IN1_AUTO_MODE          0x0080
  92#define DA9063_FLG_FORCE_IN2_MANUAL_MODE        0x0100
  93#define DA9063_FLG_FORCE_IN2_AUTO_MODE          0x0200
  94#define DA9063_FLG_FORCE_IN3_MANUAL_MODE        0x0400
  95#define DA9063_FLG_FORCE_IN3_AUTO_MODE          0x0800
  96
  97/* Disable register caching. */
  98#define DA9063_FLG_NO_CACHE                     0x0008
  99
 100struct da9063;
 101
 102/* DA9063 platform data */
 103struct da9063_pdata {
 104        int                             (*init)(struct da9063 *da9063);
 105        int                             irq_base;
 106        bool                            key_power;
 107        unsigned                        flags;
 108        struct da9063_regulators_pdata  *regulators_pdata;
 109        struct led_platform_data        *leds_pdata;
 110};
 111
 112#endif  /* __MFD_DA9063_PDATA_H__ */
 113