~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/mfd/wm831x/pdata.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * include/linux/mfd/wm831x/pdata.h -- Platform data for WM831x
  4  *
  5  * Copyright 2009 Wolfson Microelectronics PLC.
  6  *
  7  * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
  8  */
  9 
 10 #ifndef __MFD_WM831X_PDATA_H__
 11 #define __MFD_WM831X_PDATA_H__
 12 
 13 struct wm831x;
 14 struct regulator_init_data;
 15 
 16 struct wm831x_backlight_pdata {
 17         int isink;     /** ISINK to use, 1 or 2 */
 18         int max_uA;    /** Maximum current to allow */
 19 };
 20 
 21 struct wm831x_backup_pdata {
 22         int charger_enable;
 23         int no_constant_voltage;  /** Disable constant voltage charging */
 24         int vlim;   /** Voltage limit in millivolts */
 25         int ilim;   /** Current limit in microamps */
 26 };
 27 
 28 struct wm831x_battery_pdata {
 29         int enable;         /** Enable charging */
 30         int fast_enable;    /** Enable fast charging */
 31         int off_mask;       /** Mask OFF while charging */
 32         int trickle_ilim;   /** Trickle charge current limit, in mA */
 33         int vsel;           /** Target voltage, in mV */
 34         int eoc_iterm;      /** End of trickle charge current, in mA */
 35         int fast_ilim;      /** Fast charge current limit, in mA */
 36         int timeout;        /** Charge cycle timeout, in minutes */
 37 };
 38 
 39 /**
 40  * Configuration for the WM831x DC-DC BuckWise convertors.  This
 41  * should be passed as driver_data in the regulator_init_data.
 42  *
 43  * Currently all the configuration is for the fast DVS switching
 44  * support of the devices.  This allows MFPs on the device to be
 45  * configured as an input to switch between two output voltages,
 46  * allowing voltage transitions without the expense of an access over
 47  * I2C or SPI buses.
 48  */
 49 struct wm831x_buckv_pdata {
 50         int dvs_control_src; /** Hardware DVS source to use (1 or 2) */
 51         int dvs_init_state;  /** DVS state to expect on startup */
 52         int dvs_state_gpio;  /** CPU GPIO to use for monitoring status */
 53 };
 54 
 55 /* Sources for status LED configuration.  Values are register values
 56  * plus 1 to allow for a zero default for preserve.
 57  */
 58 enum wm831x_status_src {
 59         WM831X_STATUS_PRESERVE = 0,  /* Keep the current hardware setting */
 60         WM831X_STATUS_OTP = 1,
 61         WM831X_STATUS_POWER = 2,
 62         WM831X_STATUS_CHARGER = 3,
 63         WM831X_STATUS_MANUAL = 4,
 64 };
 65 
 66 struct wm831x_status_pdata {
 67         enum wm831x_status_src default_src;
 68         const char *name;
 69         const char *default_trigger;
 70 };
 71 
 72 struct wm831x_touch_pdata {
 73         int fivewire;          /** 1 for five wire mode, 0 for 4 wire */
 74         int isel;              /** Current for pen down (uA) */
 75         int rpu;               /** Pen down sensitivity resistor divider */
 76         int pressure;          /** Report pressure (boolean) */
 77         unsigned int data_irq; /** Touch data ready IRQ */
 78         int data_irqf;         /** IRQ flags for data ready IRQ */
 79         unsigned int pd_irq;   /** Touch pendown detect IRQ */
 80         int pd_irqf;           /** IRQ flags for pen down IRQ */
 81 };
 82 
 83 enum wm831x_watchdog_action {
 84         WM831X_WDOG_NONE = 0,
 85         WM831X_WDOG_INTERRUPT = 1,
 86         WM831X_WDOG_RESET = 2,
 87         WM831X_WDOG_WAKE = 3,
 88 };
 89 
 90 struct wm831x_watchdog_pdata {
 91         enum wm831x_watchdog_action primary, secondary;
 92         unsigned int software:1;
 93 };
 94 
 95 #define WM831X_MAX_STATUS 2
 96 #define WM831X_MAX_DCDC   4
 97 #define WM831X_MAX_EPE    2
 98 #define WM831X_MAX_LDO    11
 99 #define WM831X_MAX_ISINK  2
100 
101 #define WM831X_GPIO_CONFIGURE 0x10000
102 #define WM831X_GPIO_NUM 16
103 
104 struct wm831x_pdata {
105         /** Used to distinguish multiple WM831x chips */
106         int wm831x_num;
107 
108         /** Called before subdevices are set up */
109         int (*pre_init)(struct wm831x *wm831x);
110         /** Called after subdevices are set up */
111         int (*post_init)(struct wm831x *wm831x);
112 
113         /** Put the /IRQ line into CMOS mode */
114         bool irq_cmos;
115 
116         /** Disable the touchscreen */
117         bool disable_touch;
118 
119         /** The driver should initiate a power off sequence during shutdown */
120         bool soft_shutdown;
121 
122         int irq_base;
123         int gpio_base;
124         int gpio_defaults[WM831X_GPIO_NUM];
125         struct wm831x_backlight_pdata *backlight;
126         struct wm831x_backup_pdata *backup;
127         struct wm831x_battery_pdata *battery;
128         struct wm831x_touch_pdata *touch;
129         struct wm831x_watchdog_pdata *watchdog;
130 
131         /** LED1 = 0 and so on */
132         struct wm831x_status_pdata *status[WM831X_MAX_STATUS];
133         /** DCDC1 = 0 and so on */
134         struct regulator_init_data *dcdc[WM831X_MAX_DCDC];
135         /** EPE1 = 0 and so on */
136         struct regulator_init_data *epe[WM831X_MAX_EPE];
137         /** LDO1 = 0 and so on */
138         struct regulator_init_data *ldo[WM831X_MAX_LDO];
139         /** ISINK1 = 0 and so on*/
140         struct regulator_init_data *isink[WM831X_MAX_ISINK];
141 };
142 
143 #endif
144 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php