Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #ifndef __MFD_PM8XXX_MISC_H__ |
| 15 | #define __MFD_PM8XXX_MISC_H__ |
| 16 | |
| 17 | #include <linux/err.h> |
| 18 | |
| 19 | #define PM8XXX_MISC_DEV_NAME "pm8xxx-misc" |
| 20 | |
| 21 | /** |
| 22 | * struct pm8xxx_misc_platform_data - PM8xxx misc driver platform data |
| 23 | * @priority: PMIC prority level in a multi-PMIC system. Lower value means |
| 24 | * greater priority. Actions are performed from highest to lowest |
| 25 | * priority PMIC. |
| 26 | */ |
| 27 | struct pm8xxx_misc_platform_data { |
| 28 | int priority; |
| 29 | }; |
| 30 | |
Anirudh Ghayal | 5213eb8 | 2011-10-24 14:44:58 +0530 | [diff] [blame^] | 31 | enum pm8xxx_uart_path_sel { |
| 32 | UART_NONE, |
| 33 | UART_TX1_RX1, |
| 34 | UART_TX2_RX2, |
| 35 | UART_TX3_RX3, |
| 36 | }; |
| 37 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 38 | #if defined(CONFIG_MFD_PM8XXX_MISC) || defined(CONFIG_MFD_PM8XXX_MISC_MODULE) |
| 39 | |
| 40 | /** |
| 41 | * pm8xxx_reset_pwr_off - switch all PM8XXX PMIC chips attached to the system to |
| 42 | * either reset or shutdown when they are turned off |
| 43 | * @reset: 0 = shudown the PMICs, 1 = shutdown and then restart the PMICs |
| 44 | * |
| 45 | * RETURNS: an appropriate -ERRNO error value on error, or zero for success. |
| 46 | */ |
| 47 | int pm8xxx_reset_pwr_off(int reset); |
| 48 | |
Anirudh Ghayal | 5213eb8 | 2011-10-24 14:44:58 +0530 | [diff] [blame^] | 49 | int pm8xxx_uart_gpio_mux_ctrl(enum pm8xxx_uart_path_sel uart_path_sel); |
| 50 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 51 | #else |
| 52 | |
| 53 | static inline int pm8xxx_reset_pwr_off(int reset) |
| 54 | { |
| 55 | return -ENODEV; |
| 56 | } |
| 57 | |
Anirudh Ghayal | 5213eb8 | 2011-10-24 14:44:58 +0530 | [diff] [blame^] | 58 | static inline int |
| 59 | pm8xxx_uart_gpio_mux_ctrl(enum pm8xxx_uart_path_sel uart_path_sel) |
| 60 | { |
| 61 | return -ENODEV; |
| 62 | } |
| 63 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 64 | #endif |
| 65 | |
| 66 | #endif |