Matt Wagantall | 1f65d9d | 2012-04-25 14:24:20 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2010-2012 Code Aurora Forum. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #ifndef __MSM_FOOTSWITCH__ |
| 15 | #define __MSM_FOOTSWITCH__ |
| 16 | |
| 17 | #include <linux/regulator/machine.h> |
| 18 | |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 19 | /* Device IDs */ |
| 20 | #define FS_GFX2D0 0 |
| 21 | #define FS_GFX2D1 1 |
| 22 | #define FS_GFX3D 2 |
| 23 | #define FS_IJPEG 3 |
| 24 | #define FS_MDP 4 |
| 25 | #define FS_MFC 5 |
| 26 | #define FS_ROT 6 |
| 27 | #define FS_VED 7 |
| 28 | #define FS_VFE 8 |
| 29 | #define FS_VPE 9 |
Matt Wagantall | 37f34b3 | 2011-08-23 18:14:47 -0700 | [diff] [blame] | 30 | #define FS_VCAP 10 |
| 31 | #define MAX_FS 11 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 32 | |
Matt Wagantall | 1f65d9d | 2012-04-25 14:24:20 -0700 | [diff] [blame] | 33 | struct fs_clk_data { |
| 34 | const char *name; |
| 35 | struct clk *clk; |
| 36 | unsigned long rate; |
| 37 | unsigned long reset_rate; |
| 38 | bool enabled; |
| 39 | }; |
| 40 | |
| 41 | struct fs_driver_data { |
| 42 | int bus_port0, bus_port1; |
| 43 | struct fs_clk_data *clks; |
| 44 | }; |
| 45 | |
Matt Wagantall | 5c92211 | 2012-05-03 19:25:28 -0700 | [diff] [blame] | 46 | #define FS_GENERIC(_drv_name, _id, _name, _dev_id, _data) \ |
| 47 | (&(struct platform_device){ \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 48 | .name = (_drv_name), \ |
| 49 | .id = (_id), \ |
| 50 | .dev = { \ |
| 51 | .platform_data = &(struct regulator_init_data){ \ |
| 52 | .constraints = { \ |
| 53 | .valid_modes_mask = REGULATOR_MODE_NORMAL, \ |
| 54 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, \ |
| 55 | }, \ |
| 56 | .num_consumer_supplies = 1, \ |
| 57 | .consumer_supplies = \ |
| 58 | &(struct regulator_consumer_supply) \ |
Matt Wagantall | 5c92211 | 2012-05-03 19:25:28 -0700 | [diff] [blame] | 59 | REGULATOR_SUPPLY((_name), (_dev_id)), \ |
Matt Wagantall | 1f65d9d | 2012-04-25 14:24:20 -0700 | [diff] [blame] | 60 | .driver_data = (_data), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 61 | } \ |
| 62 | }, \ |
| 63 | }) |
Matt Wagantall | 5c92211 | 2012-05-03 19:25:28 -0700 | [diff] [blame] | 64 | #define FS_PCOM(_id, _name, _dev_id) \ |
| 65 | FS_GENERIC("footswitch-pcom", _id, _name, _dev_id, NULL) |
| 66 | #define FS_8X60(_id, _name, _dev_id, _data) \ |
| 67 | FS_GENERIC("footswitch-8x60", _id, _name, _dev_id, _data) |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 68 | |
| 69 | #endif |