Duy Truong | e833aca | 2013-02-12 13:35:08 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -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 __MHL_MSM_H__ |
| 15 | #define __MHL_MSM_H__ |
| 16 | |
| 17 | #include <linux/types.h> |
| 18 | #include <linux/platform_device.h> |
| 19 | #include <mach/board.h> |
Abhishek Kharbanda | 16c8ae2 | 2012-05-21 11:31:15 -0700 | [diff] [blame] | 20 | #include <linux/mhl_devcap.h> |
| 21 | #include <linux/mhl_defs.h> |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 22 | |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 23 | #define MHL_DEVICE_NAME "sii8334" |
| 24 | #define MHL_DRIVER_NAME "sii8334" |
| 25 | |
| 26 | #define HPD_UP 1 |
| 27 | #define HPD_DOWN 0 |
| 28 | |
Abhishek Kharbanda | 16c8ae2 | 2012-05-21 11:31:15 -0700 | [diff] [blame] | 29 | enum discovery_result_enum { |
| 30 | MHL_DISCOVERY_RESULT_USB = 0, |
| 31 | MHL_DISCOVERY_RESULT_MHL, |
| 32 | }; |
| 33 | |
| 34 | /* USB driver interface */ |
| 35 | |
| 36 | #ifdef CONFIG_FB_MSM_HDMI_MHL_8334 |
| 37 | /* mhl_device_discovery */ |
| 38 | extern int mhl_device_discovery(const char *name, int *result); |
| 39 | |
| 40 | /* - register|unregister MHL cable plug callback. */ |
| 41 | extern int mhl_register_callback |
| 42 | (const char *name, void (*callback)(int online)); |
| 43 | extern int mhl_unregister_callback(const char *name); |
| 44 | #else |
| 45 | static inline int mhl_device_discovery(const char *name, int *result) |
| 46 | { |
| 47 | return -ENODEV; |
| 48 | } |
| 49 | |
| 50 | static inline int |
| 51 | mhl_register_callback(const char *name, void (*callback)(int online)) |
| 52 | { |
| 53 | return -ENODEV; |
| 54 | } |
| 55 | |
| 56 | static inline int mhl_unregister_callback(const char *name) |
| 57 | { |
| 58 | return -ENODEV; |
| 59 | } |
| 60 | #endif |
| 61 | |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 62 | struct mhl_msm_state_t { |
| 63 | struct i2c_client *i2c_client; |
| 64 | struct i2c_driver *i2c_driver; |
| 65 | uint8_t cur_state; |
| 66 | uint8_t chip_rev_id; |
| 67 | struct msm_mhl_platform_data *mhl_data; |
Abhishek Kharbanda | 16c8ae2 | 2012-05-21 11:31:15 -0700 | [diff] [blame] | 68 | /* Device Discovery stuff */ |
| 69 | int mhl_mode; |
| 70 | struct completion rgnd_done; |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 71 | }; |
| 72 | |
| 73 | enum { |
| 74 | TX_PAGE_TPI = 0x00, |
| 75 | TX_PAGE_L0 = 0x01, |
| 76 | TX_PAGE_L1 = 0x02, |
| 77 | TX_PAGE_2 = 0x03, |
| 78 | TX_PAGE_3 = 0x04, |
| 79 | TX_PAGE_CBUS = 0x05, |
| 80 | TX_PAGE_DDC_EDID = 0x06, |
| 81 | TX_PAGE_DDC_SEGM = 0x07, |
| 82 | }; |
| 83 | |
| 84 | enum mhl_st_type { |
| 85 | POWER_STATE_D0_NO_MHL = 0, |
| 86 | POWER_STATE_D0_MHL = 2, |
| 87 | POWER_STATE_D3 = 3, |
| 88 | }; |
| 89 | |
| 90 | enum { |
| 91 | DEV_PAGE_TPI_0 = (0x72), |
| 92 | DEV_PAGE_TX_L0_0 = (0x72), |
| 93 | DEV_PAGE_TPI_1 = (0x76), |
| 94 | DEV_PAGE_TX_L0_1 = (0x76), |
| 95 | DEV_PAGE_TX_L1_0 = (0x7A), |
| 96 | DEV_PAGE_TX_L1_1 = (0x7E), |
| 97 | DEV_PAGE_TX_2_0 = (0x92), |
| 98 | DEV_PAGE_TX_2_1 = (0x96), |
| 99 | DEV_PAGE_TX_3_0 = (0x9A), |
| 100 | DEV_PAGE_TX_3_1 = (0x9E), |
| 101 | DEV_PAGE_CBUS = (0xC8), |
| 102 | DEV_PAGE_DDC_EDID = (0xA0), |
| 103 | DEV_PAGE_DDC_SEGM = (0x60), |
| 104 | }; |
| 105 | |
| 106 | #endif /* __MHL_MSM_H__ */ |