Jack Pham | ccbbfab | 2012-04-09 19:50:20 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012, Code Aurora Forum. All rights reserved. |
| 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 | #ifndef __HSIC_SYSMON_H__ |
| 14 | #define __HSIC_SYSMON_H__ |
| 15 | |
| 16 | /** |
| 17 | * enum hsic_sysmon_device_id - Supported HSIC subsystem devices |
| 18 | */ |
| 19 | enum hsic_sysmon_device_id { |
| 20 | HSIC_SYSMON_DEV_EXT_MODEM, |
| 21 | NUM_HSIC_SYSMON_DEVS |
| 22 | }; |
| 23 | |
| 24 | #if defined(CONFIG_MSM_HSIC_SYSMON) || defined(CONFIG_MSM_HSIC_SYSMON_MODULE) |
| 25 | |
| 26 | extern int hsic_sysmon_open(enum hsic_sysmon_device_id id); |
| 27 | extern void hsic_sysmon_close(enum hsic_sysmon_device_id id); |
| 28 | extern int hsic_sysmon_read(enum hsic_sysmon_device_id id, char *data, |
| 29 | size_t len, size_t *actual_len, int timeout); |
| 30 | extern int hsic_sysmon_write(enum hsic_sysmon_device_id id, const char *data, |
| 31 | size_t len, int timeout); |
| 32 | |
| 33 | #else /* CONFIG_MSM_HSIC_SYSMON || CONFIG_MSM_HSIC_SYSMON_MODULE */ |
| 34 | |
| 35 | static inline int hsic_sysmon_open(enum hsic_sysmon_device_id id) |
| 36 | { |
| 37 | return -ENODEV; |
| 38 | } |
| 39 | |
| 40 | static inline void hsic_sysmon_close(enum hsic_sysmon_device_id id) { } |
| 41 | |
| 42 | static inline int hsic_sysmon_read(enum hsic_sysmon_device_id id, char *data, |
| 43 | size_t len, size_t *actual_len, int timeout) |
| 44 | { |
| 45 | return -ENODEV; |
| 46 | } |
| 47 | |
| 48 | static inline int hsic_sysmon_write(enum hsic_sysmon_device_id id, |
| 49 | const char *data, size_t len, int timeout) |
| 50 | { |
| 51 | return -ENODEV; |
| 52 | } |
| 53 | |
| 54 | #endif /* CONFIG_MSM_HSIC_SYSMON || CONFIG_MSM_HSIC_SYSMON_MODULE */ |
| 55 | |
| 56 | #endif /* __HSIC_SYSMON_H__ */ |