Commit 61d3a1bd6ee464535303f61331335a7ea907e643
- Diff rendering mode:
- inline
- side by side
|   | |||
| 185 | 185 | CONFIG_MSM_AMSS_VERSION=5200 | |
| 186 | 186 | CONFIG_MSM_AMSS_VERSION_WINCE=y | |
| 187 | 187 | CONFIG_MSM_AMSS_VERSION_5200=y | |
| 188 | # CONFIG_MSM_AMSS_VERSION_6120 is not set | ||
| 188 | CONFIG_MSM_AMSS_VERSION_6120=y | ||
| 189 | 189 | # CONFIG_MSM_AMSS_VERSION_6125 is not set | |
| 190 | # CONFIG_MSM_AMSS_VERSION_6150 is not set | ||
| 191 | # CONFIG_MSM_AMSS_VERSION_6210 is not set | ||
| 192 | # CONFIG_MSM_AMSS_VERSION_6220 is not set | ||
| 190 | # CONFIG_MSM_AMSS_VERSION_6150=y | ||
| 191 | # CONFIG_MSM_AMSS_VERSION_6210=y | ||
| 192 | # CONFIG_MSM_AMSS_VERSION_6220=y | ||
| 193 | 193 | # CONFIG_MSM_AMSS_VERSION_6225 is not set | |
| 194 | 194 | CONFIG_MSM_DEBUG_UART_NONE=y | |
| 195 | 195 | # CONFIG_MSM_DEBUG_UART1 is not set |
|   | |||
| 132 | 132 | msg.msg[1] = cpu_to_be32 (0); | |
| 133 | 133 | msg.msg[2] = cpu_to_be32 (0); | |
| 134 | 134 | msg.msg[3] = cpu_to_be32 (PD_CLIENT_ID); | |
| 135 | rc = | ||
| 136 | msm_rpc_call (ept, END_SESSION, &msg, 4*4 + sizeof (struct rpc_request_hdr), 15 * HZ); | ||
| 135 | rc = msm_rpc_call (ept, END_SESSION, &msg, 4*4 + sizeof (struct rpc_request_hdr), 15 * HZ); | ||
| 137 | 136 | if (rc < 0) | |
| 138 | 137 | printk ("ERROR: %s:%d %d\n", __func__, __LINE__, rc); | |
| 139 | 138 |
|   | |||
| 291 | 291 | } | |
| 292 | 292 | } | |
| 293 | 293 | ||
| 294 | #define PM_LIBPROG 0x30000061 | ||
| 295 | #if (CONFIG_MSM_AMSS_VERSION == 6220) || (CONFIG_MSM_AMSS_VERSION == 6225) | ||
| 296 | #define PM_LIBVERS 0xfb837d0b | ||
| 297 | #else | ||
| 298 | #define PM_LIBVERS 0x10001 | ||
| 299 | #endif | ||
| 300 | |||
| 301 | 294 | #if 0 | |
| 302 | 295 | static struct platform_device *msm_serial_devices[] __initdata = { | |
| 303 | 296 | &msm_device_uart1, |
arch/arm/mach-msm/gps-rfkill.c
(15 / 20)
|   | |||
| 17 | 17 | #include <linux/delay.h> | |
| 18 | 18 | #include <linux/rfkill.h> | |
| 19 | 19 | #include <asm/mach-types.h> | |
| 20 | #include <mach/amss_para.h> | ||
| 20 | 21 | ||
| 21 | 22 | #include "vogue_gps.h" | |
| 22 | 23 | #include "nmea.h" | |
| 23 | 24 | ||
| 24 | #define RPC_PDAPI_PROG 0x3000005b | ||
| 25 | #define RPC_PDAPI_CB_PROG 0x3100005b | ||
| 26 | |||
| 27 | 25 | struct rpc_ids { | |
| 28 | 26 | uint32_t client_init; | |
| 29 | 27 | uint32_t client_pd_reg; | |
| … | … | ||
| 33 | 33 | uint32_t client_deact; | |
| 34 | 34 | uint32_t get_position; | |
| 35 | 35 | uint32_t end_session; | |
| 36 | uint32_t pd_reg_msg4; | ||
| 37 | uint32_t pa_reg_msg4; | ||
| 36 | 38 | } ids; | |
| 37 | 39 | ||
| 38 | 40 | struct rpc_ids ids_6120 = { | |
| … | … | ||
| 48 | 48 | .client_deact = 0xa, | |
| 49 | 49 | .get_position = 0xb, | |
| 50 | 50 | .end_session = 0xc, | |
| 51 | .pd_reg_msg4 = 0xf3f0ffff, | ||
| 52 | .pa_reg_msg4 = 0x07ffefe0, | ||
| 51 | 53 | }; | |
| 52 | 54 | struct rpc_ids ids_5200 = { | |
| 53 | 55 | .client_init = 3, | |
| … | … | ||
| 62 | 62 | .client_deact = 0xb, | |
| 63 | 63 | .get_position = 0xc, | |
| 64 | 64 | .end_session = 0xd, | |
| 65 | .pd_reg_msg4 = 0xf310ffff, | ||
| 66 | .pa_reg_msg4 = 0x003fefe0, | ||
| 65 | 67 | }; | |
| 66 | 68 | ||
| 67 | 69 | #define RPC_PDSM_ATL_PROG 0x3000001d | |
| … | … | ||
| 118 | 118 | } | |
| 119 | 119 | ||
| 120 | 120 | static struct msm_rpc_server pdapi_rpc_server = { | |
| 121 | .prog = RPC_PDAPI_CB_PROG, | ||
| 122 | 121 | .vers = 0, | |
| 123 | 122 | .rpc_call = handle_pdapi_rpc_call, | |
| 124 | 123 | }; | |
| 125 | 124 | ||
| 126 | 125 | static struct msm_rpc_server pdsm_atl_rpc_server = { | |
| 127 | .prog = RPC_PDSM_ATL_CB_PROG, | ||
| 128 | 126 | .vers = 0, | |
| 129 | 127 | .rpc_call = handle_pdsm_atl_rpc_call, | |
| 130 | 128 | }; | |
| … | … | ||
| 141 | 141 | } rep; | |
| 142 | 142 | ||
| 143 | 143 | /* register CB */ | |
| 144 | pdapi_rpc_server.prog = amss_get_num_value(RPC_PDAPI_CB_PROG); | ||
| 145 | pdsm_atl_rpc_server.prog = amss_get_num_value(RPC_PDSM_ATL_CB_PROG); | ||
| 144 | 146 | msm_rpc_create_server(&pdapi_rpc_server); | |
| 145 | 147 | msm_rpc_create_server(&pdsm_atl_rpc_server); | |
| 146 | 148 | ||
| … | … | ||
| 163 | 163 | msg.msg[1] = cpu_to_be32 (0x0); | |
| 164 | 164 | msg.msg[2] = cpu_to_be32 (0x0); | |
| 165 | 165 | msg.msg[3] = cpu_to_be32 (0x0); | |
| 166 | #if (CONFIG_MSM_AMSS_VERSION == 6120) || (CONFIG_MSM_AMSS_VERSION == 6125) | ||
| 167 | msg.msg[4] = cpu_to_be32 (0xf3f0ffff); | ||
| 168 | #elif (CONFIG_MSM_AMSS_VERSION == 5200) || (CONFIG_MSM_AMSS_VERSION == 6150) | ||
| 169 | msg.msg[4] = cpu_to_be32 (0xf310ffff); | ||
| 170 | #else | ||
| 171 | #error "Unknown AMSS version" | ||
| 172 | #endif | ||
| 166 | msg.msg[4] = cpu_to_be32 (ids.pd_reg_msg4); | ||
| 173 | 167 | msg.msg[5] = cpu_to_be32 (0xffffffff); | |
| 174 | 168 | rc = msm_rpc_call_reply (ept, ids.client_pd_reg, &msg, | |
| 175 | 169 | 6*4 + sizeof (struct rpc_request_hdr), | |
| … | … | ||
| 207 | 207 | msg.msg[1] = cpu_to_be32 (0x0); | |
| 208 | 208 | msg.msg[2] = cpu_to_be32 (0x2); | |
| 209 | 209 | msg.msg[3] = cpu_to_be32 (0x0); | |
| 210 | #if (CONFIG_MSM_AMSS_VERSION == 6120) || (CONFIG_MSM_AMSS_VERSION == 6125) | ||
| 211 | msg.msg[4] = cpu_to_be32 (0x07ffefe0); | ||
| 212 | #elif (CONFIG_MSM_AMSS_VERSION == 5200) || (CONFIG_MSM_AMSS_VERSION == 6150) | ||
| 213 | msg.msg[4] = cpu_to_be32 (0x003fefe0); | ||
| 214 | #else | ||
| 215 | #error "Unknown AMSS version" | ||
| 216 | #endif | ||
| 210 | msg.msg[4] = cpu_to_be32 (ids.pa_reg_msg4); | ||
| 217 | 211 | msg.msg[5] = cpu_to_be32 (0xffffffff); | |
| 218 | 212 | rc = msm_rpc_call (ept, CLIENT_PD_REG, &msg, | |
| 219 | 213 | 6*4 + sizeof (struct rpc_request_hdr), | |
| … | … | ||
| 282 | 282 | switch (state) { | |
| 283 | 283 | case RFKILL_STATE_ON: | |
| 284 | 284 | if(!ept) { | |
| 285 | ept = msm_rpc_connect (RPC_PDAPI_PROG, 0, MSM_RPC_UNINTERRUPTIBLE); | ||
| 285 | ept = msm_rpc_connect ( | ||
| 286 | amss_get_num_value(RPC_PDAPI_PROG), | ||
| 287 | 0, | ||
| 288 | MSM_RPC_UNINTERRUPTIBLE); | ||
| 286 | 289 | if (!ept || IS_ERR (ept)) { | |
| 287 | 290 | printk ("msm_rpc_connect failed (%d)\n", (int) ept); | |
| 288 | 291 | return -1; |
arch/arm/mach-msm/htc_fb_console.c
(73 / 44)
|   | |||
| 44 | 44 | #include <asm/pgtable.h> | |
| 45 | 45 | #include <asm/mach/map.h> | |
| 46 | 46 | #include "../../../drivers/video/msm/mdp_hw.h" | |
| 47 | #include <asm/mach-types.h> | ||
| 47 | 48 | ||
| 48 | 49 | ||
| 49 | 50 | /* Defined in /arch/arm/mm/mmu.c, helps us map physical memory to virtual memory. | |
| … | … | ||
| 60 | 60 | /* Green message (color = 2), the reset color to white (color = 6) */ | |
| 61 | 61 | #define HTC_FB_MSG ("\n\n" "\x1b" "2" "HTC Linux framebuffer console by druidu" "\x1b" "7" "\n\n") | |
| 62 | 62 | ||
| 63 | /* LCD resolution */ | ||
| 64 | #define HTC_FB_LCD_WIDTH 480 | ||
| 65 | #if defined(CONFIG_MACH_HTCBLACKSTONE) || defined(CONFIG_MACH_HTCKOVSKY) || defined(CONFIG_MACH_HTCTOPAZ)|| defined(CONFIG_MACH_HTCRHODIUM) | ||
| 66 | #define HTC_FB_LCD_HEIGHT 800 | ||
| 67 | #else | ||
| 68 | #define HTC_FB_LCD_HEIGHT 640 | ||
| 69 | #endif | ||
| 63 | struct fb_para { | ||
| 64 | uint32_t htc_fb_lcd_width; | ||
| 65 | uint32_t htc_fb_lcd_height; | ||
| 66 | uint32_t htc_fb_phys; | ||
| 67 | uint32_t htc_fb_off; | ||
| 68 | uint32_t htc_fb_size; | ||
| 69 | uint32_t htc_fb_con_max_rows; | ||
| 70 | uint32_t htc_fb_con_max_cols; | ||
| 71 | } para; | ||
| 70 | 72 | ||
| 71 | /* Set max console size for a 4x4 font */ | ||
| 72 | #define HTC_FB_CON_MAX_ROWS (HTC_FB_LCD_WIDTH / 4) | ||
| 73 | #define HTC_FB_CON_MAX_COLS (HTC_FB_LCD_HEIGHT / 4) | ||
| 73 | struct fb_para blackstone_para = { | ||
| 74 | .htc_fb_lcd_width = 480, | ||
| 75 | .htc_fb_lcd_height = 800, | ||
| 76 | .htc_fb_phys = 0x16800000, | ||
| 77 | .htc_fb_off = 0x0006a000, | ||
| 78 | .htc_fb_size = 0x00200000, | ||
| 79 | .htc_fb_con_max_rows = 120, | ||
| 80 | .htc_fb_con_max_cols = 200, | ||
| 81 | }; | ||
| 74 | 82 | ||
| 83 | struct fb_para topaz_para = { | ||
| 84 | .htc_fb_lcd_width = 480, | ||
| 85 | .htc_fb_lcd_height = 800, | ||
| 86 | .htc_fb_phys = 0x15100000, | ||
| 87 | .htc_fb_off = 0x00000780, | ||
| 88 | .htc_fb_size = 0x00200000, | ||
| 89 | .htc_fb_con_max_rows = 120, | ||
| 90 | .htc_fb_con_max_cols = 200, | ||
| 91 | }; | ||
| 92 | |||
| 93 | struct fb_para default_para = { | ||
| 94 | .htc_fb_lcd_width = 480, /* LCD resolution width*/ | ||
| 95 | .htc_fb_lcd_height = 640, /* LCD resolution height*/ | ||
| 96 | .htc_fb_phys = 0x16800000, /* physical page for our fb */ | ||
| 97 | .htc_fb_off = 0x0006a000, /* offset in the page to start of fb */ | ||
| 98 | .htc_fb_size = 0x00100000, /* map 1 MB (640 * 480 * 2 rounded properly) */ | ||
| 99 | .htc_fb_con_max_rows = 120, /* Set max console size for a 4x4 font */ | ||
| 100 | .htc_fb_con_max_cols = 160, /* Set max console size for a 4x4 font */ | ||
| 101 | }; | ||
| 102 | |||
| 103 | |||
| 75 | 104 | /* Framebuffer stuff */ | |
| 76 | 105 | #define HTC_FB_BASE 0xe2000000 /* virtual page for our fb */ | |
| 77 | 106 | ||
| 78 | #if defined(CONFIG_MACH_HTCBLACKSTONE) || defined(CONFIG_MACH_HTCKOVSKY) | ||
| 79 | #define HTC_FB_PHYS 0x16800000 /* physical page for our fb */ | ||
| 80 | #define HTC_FB_OFF 0x0006a000 /* offset in the page to start of fb */ | ||
| 81 | #define HTC_FB_SIZE 0x00200000 /* map 2 MB (640 * 480 * 2 rounded properly) */ | ||
| 82 | #elif defined(CONFIG_MACH_HTCTOPAZ)|| defined(CONFIG_MACH_HTCRHODIUM) | ||
| 83 | #define HTC_FB_PHYS 0x15100000 /* physical page for our fb */ | ||
| 84 | #define HTC_FB_OFF 0x00000780 /* offset in the page to start of fb */ | ||
| 85 | #define HTC_FB_SIZE 0x00200000 /* map 2 MB (640 * 480 * 2 rounded properly) */ | ||
| 86 | #else | ||
| 87 | #define HTC_FB_PHYS 0x16800000 /* physical page for our fb */ | ||
| 88 | #define HTC_FB_OFF 0x0006a000 /* offset in the page to start of fb */ | ||
| 89 | #define HTC_FB_SIZE 0x00100000 /* map 1 MB (640 * 480 * 2 rounded properly) */ | ||
| 90 | #endif | ||
| 91 | |||
| 92 | 107 | /* Pack color data in 565 RGB format; r and b are 5 bits, g is 6 bits */ | |
| 93 | 108 | #define HTC_FB_RGB(r, g, b) ((((r) & 0x1f) << 11) | (((g) & 0x3f) << 5) | (((b) & 0x1f) << 0)) | |
| 94 | 109 | ||
| … | … | ||
| 137 | 137 | /* Current fg / bg colors */ | |
| 138 | 138 | unsigned char htc_fb_cur_fg, htc_fb_cur_bg; | |
| 139 | 139 | ||
| 140 | /* Buffer to hold characters and attributes */ | ||
| 141 | unsigned char htc_fb_chars[HTC_FB_CON_MAX_ROWS][HTC_FB_CON_MAX_COLS]; | ||
| 142 | unsigned char htc_fb_fg[HTC_FB_CON_MAX_ROWS][HTC_FB_CON_MAX_COLS]; | ||
| 143 | unsigned char htc_fb_bg[HTC_FB_CON_MAX_ROWS][HTC_FB_CON_MAX_COLS]; | ||
| 140 | /* Buffer to hold characters and attributes, set it to the biggest size! */ | ||
| 141 | unsigned char htc_fb_chars[120][200]; | ||
| 142 | unsigned char htc_fb_fg[120][200]; | ||
| 143 | unsigned char htc_fb_bg[120][200]; | ||
| 144 | 144 | ||
| 145 | 145 | static void htc_fb_console_write(struct console *console, const char *s, unsigned int count); | |
| 146 | 146 | ||
| … | … | ||
| 165 | 165 | unsigned short *ptr; | |
| 166 | 166 | unsigned char ch; | |
| 167 | 167 | ||
| 168 | fbram = HTC_FB_PHYS + HTC_FB_OFF; | ||
| 169 | memaddr = HTC_FB_BASE + HTC_FB_OFF; | ||
| 168 | fbram = para.htc_fb_phys + para.htc_fb_off; | ||
| 169 | memaddr = HTC_FB_BASE + para.htc_fb_off; | ||
| 170 | 170 | ||
| 171 | 171 | ptr = (unsigned short*) memaddr; | |
| 172 | 172 | for (i = 0; i < htc_fb_console_rows * htc_fb_font_rows; i++) { | |
| … | … | ||
| 180 | 180 | ? htc_fb_colors[htc_fb_fg[r1][c1]] | |
| 181 | 181 | : htc_fb_colors[htc_fb_bg[r1][c1]]; | |
| 182 | 182 | } | |
| 183 | ptr += HTC_FB_LCD_WIDTH - htc_fb_console_cols * htc_fb_font_cols; | ||
| 183 | ptr += para.htc_fb_lcd_width - htc_fb_console_cols * htc_fb_font_cols; | ||
| 184 | 184 | } | |
| 185 | 185 | ||
| 186 | stride = HTC_FB_LCD_WIDTH * 2; | ||
| 187 | width = HTC_FB_LCD_WIDTH; | ||
| 188 | height = HTC_FB_LCD_HEIGHT; | ||
| 186 | stride = para.htc_fb_lcd_width * 2; | ||
| 187 | width = para.htc_fb_lcd_width; | ||
| 188 | height = para.htc_fb_lcd_height; | ||
| 189 | 189 | x = 0; | |
| 190 | 190 | y = 0; | |
| 191 | 191 | ||
| … | … | ||
| 226 | 226 | static void htc_fb_console_clear(void) | |
| 227 | 227 | { | |
| 228 | 228 | /* Default white on black, clear everything */ | |
| 229 | memset((void*) (HTC_FB_BASE + HTC_FB_OFF), 0, HTC_FB_LCD_WIDTH * HTC_FB_LCD_HEIGHT * 2); | ||
| 229 | memset((void*) (HTC_FB_BASE + para.htc_fb_off), 0, para.htc_fb_lcd_width * para.htc_fb_lcd_height * 2); | ||
| 230 | 230 | memset(htc_fb_chars, 0, htc_fb_console_cols * htc_fb_console_rows); | |
| 231 | 231 | memset(htc_fb_fg, 7, htc_fb_console_cols * htc_fb_console_rows); | |
| 232 | 232 | memset(htc_fb_bg, 0, htc_fb_console_cols * htc_fb_console_rows); | |
| … | … | ||
| 327 | 327 | static int __init htc_fb_console_init(void) | |
| 328 | 328 | { | |
| 329 | 329 | struct map_desc map; | |
| 330 | switch(__machine_arch_type) { | ||
| 331 | case MACH_TYPE_HTCTOPAZ: | ||
| 332 | case MACH_TYPE_HTCRHODIUM: | ||
| 333 | memcpy(¶, &topaz_para, sizeof(para)); | ||
| 334 | break; | ||
| 335 | case MACH_TYPE_HTCBLACKSTONE: | ||
| 336 | case MACH_TYPE_HTCKOVSKY: | ||
| 337 | memcpy(¶, &blackstone_para, sizeof(para)); | ||
| 338 | break; | ||
| 339 | default: | ||
| 340 | memcpy(¶, &default_para, sizeof(para)); | ||
| 341 | break; | ||
| 342 | } | ||
| 330 | 343 | ||
| 331 | 344 | /* Map the framebuffer Windows was using, as we know the physical address */ | |
| 332 | map.pfn = __phys_to_pfn(HTC_FB_PHYS & SECTION_MASK); | ||
| 345 | map.pfn = __phys_to_pfn(para.htc_fb_phys & SECTION_MASK); | ||
| 333 | 346 | map.virtual = HTC_FB_BASE; | |
| 334 | map.length = ((unsigned long) HTC_FB_SIZE + ~SECTION_MASK) & SECTION_MASK; | ||
| 347 | map.length = ((unsigned long) para.htc_fb_size + ~SECTION_MASK) & SECTION_MASK; | ||
| 335 | 348 | map.type = MT_MEMORY; | |
| 336 | 349 | /* Ugly hack, but we're not sure what works and what doesn't, | |
| 337 | 350 | * so better use the lowest level we have for setting the mapping */ | |
| 338 | 351 | create_mapping(&map); | |
| 339 | 352 | ||
| 340 | 353 | /* Init font (we support any font that has width <= 8; height doesn't matter) */ | |
| 341 | htc_fb_default_font = get_default_font(HTC_FB_LCD_WIDTH, HTC_FB_LCD_HEIGHT, 0xFF, 0xFFFFFFFF); | ||
| 354 | htc_fb_default_font = get_default_font(para.htc_fb_lcd_width, para.htc_fb_lcd_height, 0xFF, 0xFFFFFFFF); | ||
| 342 | 355 | if (!htc_fb_default_font) { | |
| 343 | 356 | printk(KERN_WARNING "Can't find a suitable font for htc_fb"); | |
| 344 | 357 | return -1; | |
| … | … | ||
| 360 | 360 | htc_fb_font_data = htc_fb_default_font->data; | |
| 361 | 361 | htc_fb_font_cols = htc_fb_default_font->width; | |
| 362 | 362 | htc_fb_font_rows = htc_fb_default_font->height; | |
| 363 | htc_fb_console_cols = HTC_FB_LCD_WIDTH / htc_fb_font_cols; | ||
| 364 | if (htc_fb_console_cols > HTC_FB_CON_MAX_COLS) | ||
| 365 | htc_fb_console_cols = HTC_FB_CON_MAX_COLS; | ||
| 366 | htc_fb_console_rows = HTC_FB_LCD_HEIGHT / htc_fb_font_rows; | ||
| 367 | if (htc_fb_console_rows > HTC_FB_CON_MAX_ROWS) | ||
| 368 | htc_fb_console_rows = HTC_FB_CON_MAX_ROWS; | ||
| 363 | htc_fb_console_cols = para.htc_fb_lcd_width / htc_fb_font_cols; | ||
| 364 | if (htc_fb_console_cols > para.htc_fb_con_max_cols) | ||
| 365 | htc_fb_console_cols = para.htc_fb_con_max_cols; | ||
| 366 | htc_fb_console_rows = para.htc_fb_lcd_height / htc_fb_font_rows; | ||
| 367 | if (htc_fb_console_rows > para.htc_fb_con_max_rows) | ||
| 368 | htc_fb_console_rows = para.htc_fb_con_max_rows; | ||
| 369 | 369 | ||
| 370 | 370 | /* Clear the buffer; we could probably see the Haret output if we didn't clear | |
| 371 | 371 | * the buffer (if it used same physical address) */ |
|   | |||
| 1 | /* | ||
| 2 | * Author: Markinus | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 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 | |||
| 15 | #ifndef _ARCH_ARM_MACH_MSM_AMSS_PARA_H | ||
| 16 | #define _ARCH_ARM_MACH_MSM_AMSS_PARA_H | ||
| 17 | |||
| 18 | |||
| 19 | struct amss_value { | ||
| 20 | int id; | ||
| 21 | uint32_t numval; | ||
| 22 | char* strval; | ||
| 23 | }; | ||
| 24 | |||
| 25 | // The enum with AMSS IDs, it have to have the same order and size as the default para struct in the c file! | ||
| 26 | enum amss_ids { | ||
| 27 | AUDMGR_PROG_VERS=0, | ||
| 28 | AUDMGR_PROG, | ||
| 29 | AUDMGR_VERS, | ||
| 30 | AUDMGR_CB_PROG_VERS, | ||
| 31 | AUDMGR_CB_PROG, | ||
| 32 | AUDMGR_CB_VERS, | ||
| 33 | TIME_REMOTE_MTOA_PROG, | ||
| 34 | TIME_REMOTE_MTOA_VERS, | ||
| 35 | RPC_TIME_REMOTE_MTOA_NULL, | ||
| 36 | RPC_TIME_TOD_SET_APPS_BASES, | ||
| 37 | PM_LIBPROG, | ||
| 38 | PM_LIBVERS, | ||
| 39 | RPC_SND_PROG, | ||
| 40 | RPC_SND_VERS, | ||
| 41 | SND_SET_DEVICE_PROC, | ||
| 42 | SND_SET_VOLUME_PROC, | ||
| 43 | RPC_ADSP_RTOS_ATOM_PROG_VERS, | ||
| 44 | RPC_ADSP_RTOS_ATOM_PROG, | ||
| 45 | RPC_ADSP_RTOS_ATOM_VERS, | ||
| 46 | RPC_ADSP_RTOS_MTOA_PROG, | ||
| 47 | RPC_ADSP_RTOS_MTOA_VERS, | ||
| 48 | RPC_ADSP_RTOS_ATOM_NULL_PROC, | ||
| 49 | RPC_ADSP_RTOS_MTOA_NULL_PROC, | ||
| 50 | RPC_ADSP_RTOS_APP_TO_MODEM_PROC, | ||
| 51 | RPC_ADSP_RTOS_MODEM_TO_APP_PROC, | ||
| 52 | RPC_DOG_KEEPALIVE_NULL, | ||
| 53 | RPC_DOG_KEEPALIVE_BEACON, | ||
| 54 | DOG_KEEPALIVE_PROG, | ||
| 55 | DOG_KEEPALIVE_VERS, | ||
| 56 | RPC_PDAPI_PROG, | ||
| 57 | RPC_PDAPI_CB_PROG | ||
| 58 | }; | ||
| 59 | |||
| 60 | extern uint32_t amss_get_num_value(int); | ||
| 61 | |||
| 62 | extern void amss_get_str_value(int, char*, size_t); | ||
| 63 | |||
| 64 | |||
| 65 | #endif //LOCK |
arch/arm/mach-msm/msm_vibrator.c
(5 / 10)
|   | |||
| 18 | 18 | #include <linux/err.h> | |
| 19 | 19 | #include <linux/hrtimer.h> | |
| 20 | 20 | #include <linux/timed_output.h> | |
| 21 | #include <mach/amss_para.h> | ||
| 21 | 22 | ||
| 22 | 23 | #include <mach/msm_rpcrouter.h> | |
| 23 | 24 | ||
| 24 | 25 | #include "proc_comm_wince.h" | |
| 25 | 26 | ||
| 26 | #define PM_LIBPROG 0x30000061 | ||
| 27 | #if (CONFIG_MSM_AMSS_VERSION == 6220) || (CONFIG_MSM_AMSS_VERSION == 6225) | ||
| 28 | #define PM_LIBVERS 0xfb837d0b | ||
| 29 | #elif (CONFIG_MSM_AMSS_VERSION == 6120) | ||
| 30 | #define PM_LIBVERS 0x0 | ||
| 31 | #else | ||
| 32 | #define PM_LIBVERS 0x10001 | ||
| 33 | #endif | ||
| 34 | |||
| 35 | 27 | #define HTC_PROCEDURE_SET_VIB_ON_OFF 21 | |
| 36 | 28 | #define PMIC_VIBRATOR_LEVEL (3000) | |
| 37 | 29 | ||
| … | … | ||
| 42 | 42 | } req; | |
| 43 | 43 | ||
| 44 | 44 | if (!vib_endpoint) { | |
| 45 | vib_endpoint = msm_rpc_connect(PM_LIBPROG, PM_LIBVERS, 0); | ||
| 45 | vib_endpoint = msm_rpc_connect( | ||
| 46 | amss_get_num_value(PM_LIBPROG), | ||
| 47 | amss_get_num_value(PM_LIBVERS), | ||
| 48 | 0); | ||
| 46 | 49 | if (IS_ERR(vib_endpoint)) { | |
| 47 | 50 | printk(KERN_ERR "init vib rpc failed!\n"); | |
| 48 | 51 | vib_endpoint = 0; |
|   | |||
| 15 | 15 | obj-y += adsp_lpm_verify_cmd.o | |
| 16 | 16 | obj-y += audio_out.o audio_in.o audio_mp3.o audmgr.o audpp.o | |
| 17 | 17 | obj-y += snd.o | |
| 18 | obj-y += amss_para.o | ||
| 18 | 19 | ||
| 19 | 20 | obj-y += adsp_5200.o | |
| 20 | 21 | obj-y += adsp_6120.o |
arch/arm/mach-msm/qdsp5/adsp.c
(46 / 34)
|   | |||
| 35 | 35 | #include <linux/wakelock.h> | |
| 36 | 36 | #include <asm/mach-types.h> | |
| 37 | 37 | #include "../smd_rpcrouter.h" | |
| 38 | #include <mach/amss_para.h> | ||
| 38 | 39 | ||
| 39 | 40 | static struct wake_lock adsp_wake_lock; | |
| 40 | 41 | static inline void prevent_suspend(void) | |
| … | … | ||
| 91 | 91 | struct rpc_reply_hdr *rpc_rsp; | |
| 92 | 92 | ||
| 93 | 93 | msm_rpc_setup_req(&rpc_req.hdr, | |
| 94 | RPC_ADSP_RTOS_ATOM_PROG, | ||
| 95 | RPC_ADSP_RTOS_ATOM_VERS, | ||
| 96 | RPC_ADSP_RTOS_APP_TO_MODEM_PROC); | ||
| 94 | amss_get_num_value(RPC_ADSP_RTOS_ATOM_PROG), | ||
| 95 | amss_get_num_value(RPC_ADSP_RTOS_ATOM_VERS), | ||
| 96 | amss_get_num_value(RPC_ADSP_RTOS_APP_TO_MODEM_PROC)); | ||
| 97 | 97 | ||
| 98 | 98 | rpc_req.gotit = cpu_to_be32(1); | |
| 99 | 99 | rpc_req.cmd = cpu_to_be32(cmd); | |
| … | … | ||
| 153 | 153 | static int adsp_rpc_init(struct msm_adsp_module *adsp_module) | |
| 154 | 154 | { | |
| 155 | 155 | adsp_module->rpc_client = msm_rpc_connect( | |
| 156 | RPC_ADSP_RTOS_ATOM_PROG, | ||
| 157 | RPC_ADSP_RTOS_ATOM_VERS, | ||
| 158 | MSM_RPC_UNINTERRUPTIBLE); | ||
| 156 | amss_get_num_value(RPC_ADSP_RTOS_ATOM_PROG), | ||
| 157 | amss_get_num_value(RPC_ADSP_RTOS_ATOM_VERS), | ||
| 158 | amss_get_num_value(MSM_RPC_UNINTERRUPTIBLE)); | ||
| 159 | 159 | ||
| 160 | 160 | if (IS_ERR(adsp_module->rpc_client)) { | |
| 161 | 161 | int rc = PTR_ERR(adsp_module->rpc_client); | |
| … | … | ||
| 433 | 433 | ||
| 434 | 434 | static void handle_adsp_rtos_mtoa_app(struct rpc_request_hdr *req) | |
| 435 | 435 | { | |
| 436 | struct rpc_adsp_rtos_modem_to_app_args_t *args = | ||
| 437 | (struct rpc_adsp_rtos_modem_to_app_args_t *)req; | ||
| 438 | uint32_t event = be32_to_cpu(args->event); | ||
| 439 | uint32_t proc_id = be32_to_cpu(args->proc_id); | ||
| 440 | uint32_t module_id = be32_to_cpu(args->module); | ||
| 441 | uint32_t image = be32_to_cpu(args->image); | ||
| 436 | uint32_t event = 0; | ||
| 437 | uint32_t proc_id = 0; | ||
| 438 | uint32_t module_id = 0; | ||
| 439 | uint32_t image = 0; | ||
| 440 | |||
| 441 | switch(__machine_arch_type) { | ||
| 442 | case MACH_TYPE_HTCTOPAZ: | ||
| 443 | case MACH_TYPE_HTCRHODIUM: { | ||
| 444 | struct rpc_adsp_rtos_modem_to_app_args_t_6120 *args = | ||
| 445 | (struct rpc_adsp_rtos_modem_to_app_args_t_6120 *)req; | ||
| 446 | event = be32_to_cpu(args->event); | ||
| 447 | proc_id = be32_to_cpu(args->proc_id); | ||
| 448 | module_id = be32_to_cpu(args->module); | ||
| 449 | image = be32_to_cpu(args->image); | ||
| 450 | break; | ||
| 451 | } | ||
| 452 | default: { | ||
| 453 | struct rpc_adsp_rtos_modem_to_app_args_t *args = | ||
| 454 | (struct rpc_adsp_rtos_modem_to_app_args_t *)req; | ||
| 455 | event = be32_to_cpu(args->event); | ||
| 456 | proc_id = be32_to_cpu(args->proc_id); | ||
| 457 | module_id = be32_to_cpu(args->module); | ||
| 458 | image = be32_to_cpu(args->image); | ||
| 459 | break; | ||
| 460 | } | ||
| 461 | } | ||
| 442 | 462 | struct msm_adsp_module *module; | |
| 443 | 463 | ||
| 444 | 464 | pr_info("adsp: rpc event=%d, proc_id=%d, module=%d, image=%d\n", | |
| … | … | ||
| 510 | 510 | ||
| 511 | 511 | static int handle_adsp_rtos_mtoa(struct rpc_request_hdr *req) | |
| 512 | 512 | { | |
| 513 | switch (req->procedure) { | ||
| 514 | case RPC_ADSP_RTOS_MTOA_NULL_PROC: | ||
| 513 | if(req->procedure == amss_get_num_value(RPC_ADSP_RTOS_MTOA_NULL_PROC)) { | ||
| 515 | 514 | rpc_send_accepted_void_reply(rpc_cb_server_client, | |
| 516 | 515 | req->xid, | |
| 517 | 516 | RPC_ACCEPTSTAT_SUCCESS); | |
| 518 | break; | ||
| 519 | case RPC_ADSP_RTOS_MODEM_TO_APP_PROC: | ||
| 517 | } | ||
| 518 | else if(req->procedure == amss_get_num_value(RPC_ADSP_RTOS_MODEM_TO_APP_PROC)) { | ||
| 520 | 519 | handle_adsp_rtos_mtoa_app(req); | |
| 521 | break; | ||
| 522 | default: | ||
| 520 | } | ||
| 521 | else { | ||
| 523 | 522 | pr_err("adsp: unknowned proc %d\n", req->procedure); | |
| 524 | 523 | rpc_send_accepted_void_reply( | |
| 525 | 524 | rpc_cb_server_client, req->xid, | |
| 526 | 525 | RPC_ACCEPTSTAT_PROC_UNAVAIL); | |
| 527 | break; | ||
| 528 | 526 | } | |
| 529 | 527 | return 0; | |
| 530 | 528 | } | |
| … | … | ||
| 553 | 553 | goto bad_rpc; | |
| 554 | 554 | if (req->rpc_vers != 2) | |
| 555 | 555 | goto bad_rpc; | |
| 556 | if (req->prog != RPC_ADSP_RTOS_MTOA_PROG) | ||
| 556 | if (req->prog != amss_get_num_value(RPC_ADSP_RTOS_MTOA_PROG)) | ||
| 557 | 557 | goto bad_rpc; | |
| 558 | if (req->vers != RPC_ADSP_RTOS_MTOA_VERS) | ||
| 558 | if (req->vers != amss_get_num_value(RPC_ADSP_RTOS_MTOA_VERS)) | ||
| 559 | 559 | goto bad_rpc; | |
| 560 | 560 | ||
| 561 | 561 | handle_adsp_rtos_mtoa(req); | |
| … | … | ||
| 880 | 880 | rpc_cb_server_client->cid=adsp_cid; | |
| 881 | 881 | ||
| 882 | 882 | rc = msm_rpc_register_server(rpc_cb_server_client, | |
| 883 | RPC_ADSP_RTOS_MTOA_PROG, | ||
| 884 | RPC_ADSP_RTOS_MTOA_VERS); | ||
| 883 | amss_get_num_value(RPC_ADSP_RTOS_MTOA_PROG), | ||
| 884 | amss_get_num_value(RPC_ADSP_RTOS_MTOA_VERS)); | ||
| 885 | 885 | ||
| 886 | 886 | if (rc) { | |
| 887 | 887 | pr_err("adsp: could not register callback server (%d)\n", rc); | |
| … | … | ||
| 931 | 931 | static struct platform_driver msm_adsp_driver = { | |
| 932 | 932 | .probe = msm_adsp_probe, | |
| 933 | 933 | .driver = { | |
| 934 | #if CONFIG_MSM_AMSS_VERSION == 6210 | ||
| 935 | .name = "rs3000000a:20f17fd3", | ||
| 936 | #elif (CONFIG_MSM_AMSS_VERSION == 6220) || (CONFIG_MSM_AMSS_VERSION == 6225) | ||
| 937 | .name = "rs3000000a:71d1094b", | ||
| 938 | #elif (CONFIG_MSM_AMSS_VERSION == 5200) || (CONFIG_MSM_AMSS_VERSION == 6120) || (CONFIG_MSM_AMSS_VERSION == 6125) | ||
| 939 | .name = "rs3000000a:00000000", | ||
| 940 | #elif CONFIG_MSM_AMSS_VERSION == 6150 /* TODO */ | ||
| 941 | .name = "rs3000000a:00000000", | ||
| 942 | #else | ||
| 943 | #error "Unknown AMSS version" | ||
| 944 | #endif | ||
| 945 | 934 | .owner = THIS_MODULE, | |
| 946 | 935 | }, | |
| 947 | 936 | }; | |
| … | … | ||
| 939 | 939 | { | |
| 940 | 940 | int i; | |
| 941 | 941 | unsigned *rpcchan; | |
| 942 | char drivename[20]; | ||
| 942 | 943 | ||
| 943 | 944 | /* | |
| 944 | 945 | if(!adsp_cid) { | |
| … | … | ||
| 956 | 956 | printk("Using adsp_cid=%08x\n", adsp_cid); | |
| 957 | 957 | } | |
| 958 | 958 | */ | |
| 959 | amss_get_str_value(RPC_ADSP_RTOS_ATOM_PROG_VERS, drivename, sizeof(drivename)); | ||
| 960 | msm_adsp_driver.driver.name = drivename; | ||
| 961 | pr_err("ADSP DRIVERNAME: %s \n", msm_adsp_driver.driver.name); | ||
| 959 | 962 | ||
| 960 | 963 | return platform_driver_register(&msm_adsp_driver); | |
| 961 | 964 | } |
arch/arm/mach-msm/qdsp5/adsp.h
(9 / 23)
|   | |||
| 110 | 110 | uint32_t event_backlog_max; | |
| 111 | 111 | }; | |
| 112 | 112 | ||
| 113 | #define RPC_ADSP_RTOS_ATOM_PROG 0x3000000a | ||
| 114 | #define RPC_ADSP_RTOS_MTOA_PROG 0x3000000b | ||
| 115 | #define RPC_ADSP_RTOS_ATOM_NULL_PROC 0 | ||
| 116 | #define RPC_ADSP_RTOS_MTOA_NULL_PROC 0 | ||
| 117 | #define RPC_ADSP_RTOS_APP_TO_MODEM_PROC 1 | ||
| 118 | #define RPC_ADSP_RTOS_MODEM_TO_APP_PROC 1 | ||
| 119 | |||
| 120 | //Move that to adsp_info ? | ||
| 121 | #if CONFIG_MSM_AMSS_VERSION == 6210 | ||
| 122 | #define RPC_ADSP_RTOS_ATOM_VERS 0x20f17fd3 | ||
| 123 | #define RPC_ADSP_RTOS_MTOA_VERS 0x75babbd6 | ||
| 124 | #elif (CONFIG_MSM_AMSS_VERSION == 6220) || (CONFIG_MSM_AMSS_VERSION == 6225) | ||
| 125 | #define RPC_ADSP_RTOS_ATOM_VERS 0x71d1094b | ||
| 126 | #define RPC_ADSP_RTOS_MTOA_VERS 0xee3a9966 | ||
| 127 | #elif (CONFIG_MSM_AMSS_VERSION == 5200) || (CONFIG_MSM_AMSS_VERSION == 6150) || (CONFIG_MSM_AMSS_VERSION == 6120) || (CONFIG_MSM_AMSS_VERSION == 6125) | ||
| 128 | #define RPC_ADSP_RTOS_ATOM_VERS 0x0 | ||
| 129 | #define RPC_ADSP_RTOS_MTOA_VERS 0x0 | ||
| 130 | #else | ||
| 131 | #error "Unknown AMSS version" | ||
| 132 | #endif | ||
| 133 | |||
| 134 | 113 | enum rpc_adsp_rtos_proc_type { | |
| 135 | 114 | RPC_ADSP_RTOS_PROC_NONE = 0, | |
| 136 | 115 | RPC_ADSP_RTOS_PROC_MODEM = 1, | |
| … | … | ||
| 151 | 151 | uint32_t proc_id; /* e.g., RPC_ADSP_RTOS_PROC_APPS */ | |
| 152 | 152 | uint32_t module; /* e.g., QDSP_MODULE_AUDPPTASK */ | |
| 153 | 153 | uint32_t image; /* RPC_QDSP_IMAGE_GAUDIO */ | |
| 154 | #if (CONFIG_MSM_AMSS_VERSION == 6120) || (CONFIG_MSM_AMSS_VERSION == 6125) | ||
| 154 | }; | ||
| 155 | |||
| 156 | struct rpc_adsp_rtos_modem_to_app_args_t_6120 { | ||
| 157 | struct rpc_request_hdr hdr; | ||
| 158 | uint32_t gotit; /* if 1, the next elements are present */ | ||
| 159 | uint32_t event; /* e.g., RPC_ADSP_RTOS_CMD_REGISTER_APP */ | ||
| 160 | uint32_t proc_id; /* e.g., RPC_ADSP_RTOS_PROC_APPS */ | ||
| 161 | uint32_t module; /* e.g., QDSP_MODULE_AUDPPTASK */ | ||
| 162 | uint32_t image; /* RPC_QDSP_IMAGE_GAUDIO */ | ||
| 155 | 163 | uint32_t unknown; /* unknown*/ | |
| 156 | #endif | ||
| 157 | 164 | }; | |
| 158 | 165 | ||
| 159 | 166 | #define ADSP_STATE_DISABLED 0 |
arch/arm/mach-msm/qdsp5/amss_para.c
(200 / 0)
|   | |||
| 1 | /* | ||
| 2 | * Author: Markinus | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 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 | #include <linux/init.h> | ||
| 15 | |||
| 16 | #include <linux/module.h> | ||
| 17 | #include <linux/mutex.h> | ||
| 18 | #include <linux/err.h> | ||
| 19 | |||
| 20 | #include <asm/mach-types.h> | ||
| 21 | #include <mach/amss_para.h> | ||
| 22 | |||
| 23 | // The struckt array with the AMSS default Values, it have to have the same order and size as the enum with AMSS IDs in the Heaader File! | ||
| 24 | struct amss_value amss_def_para[] = { | ||
| 25 | {AUDMGR_PROG_VERS,0, "rs30000013:e94e8f0c"}, | ||
| 26 | {AUDMGR_PROG, 0x30000013, ""}, | ||
| 27 | {AUDMGR_VERS, 0xe94e8f0c, ""}, | ||
| 28 | {AUDMGR_CB_PROG_VERS,0, "rs31000013:21570ba7"}, | ||
| 29 | {AUDMGR_CB_PROG, 0x31000013, ""}, | ||
| 30 | {AUDMGR_CB_VERS, 0x21570ba7, ""}, | ||
| 31 | {TIME_REMOTE_MTOA_PROG, 0x3000005d, ""}, | ||
| 32 | {TIME_REMOTE_MTOA_VERS, 0, ""}, | ||
| 33 | {RPC_TIME_REMOTE_MTOA_NULL, 0, ""}, | ||
| 34 | {RPC_TIME_TOD_SET_APPS_BASES, 1, ""}, | ||
| 35 | {PM_LIBPROG, 0x30000061, ""}, | ||
| 36 | {PM_LIBVERS, 0x10001, ""}, | ||
| 37 | {RPC_SND_PROG, 0x30000002, ""}, | ||
| 38 | {RPC_SND_VERS, 0x0, ""}, | ||
| 39 | {SND_SET_DEVICE_PROC, 1, ""}, | ||
| 40 | {SND_SET_VOLUME_PROC, 2, ""}, | ||
| 41 | {RPC_ADSP_RTOS_ATOM_PROG_VERS, 0, ""}, | ||
| 42 | {RPC_ADSP_RTOS_ATOM_PROG, 0x3000000a, ""}, | ||
| 43 | {RPC_ADSP_RTOS_ATOM_VERS, 0x0, ""}, | ||
| 44 | {RPC_ADSP_RTOS_MTOA_PROG, 0x3000000b, ""}, | ||
| 45 | {RPC_ADSP_RTOS_MTOA_VERS, 0x0, ""}, | ||
| 46 | {RPC_ADSP_RTOS_ATOM_NULL_PROC, 0, ""}, | ||
| 47 | {RPC_ADSP_RTOS_MTOA_NULL_PROC, 0, ""}, | ||
| 48 | {RPC_ADSP_RTOS_APP_TO_MODEM_PROC, 1, ""}, | ||
| 49 | {RPC_ADSP_RTOS_MODEM_TO_APP_PROC, 1, ""}, | ||
| 50 | {RPC_DOG_KEEPALIVE_NULL, 0, ""}, | ||
| 51 | {RPC_DOG_KEEPALIVE_BEACON, 1, ""}, | ||
| 52 | {DOG_KEEPALIVE_PROG, 0x30000015, ""}, | ||
| 53 | {DOG_KEEPALIVE_VERS, 0, ""}, | ||
| 54 | {RPC_PDAPI_PROG, 0x3000005b, ""}, | ||
| 55 | {RPC_PDAPI_CB_PROG, 0x3100005b, ""}, | ||
| 56 | }; | ||
| 57 | |||
| 58 | |||
| 59 | // Now the version spezificly values | ||
| 60 | struct amss_value amss_6120_para[] = { | ||
| 61 | {AUDMGR_PROG_VERS,0, "rs30000013:00000000"}, | ||
| 62 | {AUDMGR_VERS, 0x0, ""}, | ||
| 63 | {AUDMGR_CB_PROG_VERS,0, "rs31000013:00000000"}, | ||
| 64 | {AUDMGR_CB_VERS, 0x00000000, ""}, | ||
| 65 | {RPC_SND_VERS, 0xaa2b1a44, ""}, | ||
| 66 | {SND_SET_DEVICE_PROC, 2, ""}, | ||
| 67 | {SND_SET_VOLUME_PROC, 3, ""}, | ||
| 68 | {RPC_ADSP_RTOS_ATOM_PROG_VERS, 0, "rs3000000a:00000000"}, | ||
| 69 | {RPC_ADSP_RTOS_ATOM_VERS, 0x0, ""}, | ||
| 70 | {RPC_ADSP_RTOS_MTOA_VERS, 0x0, ""}, | ||
| 71 | }; | ||
| 72 | |||
| 73 | struct amss_value amss_6210_para[] = { | ||
| 74 | {AUDMGR_PROG_VERS,0, "rs30000013:46255756"}, | ||
| 75 | {AUDMGR_VERS, 0x46255756, ""}, | ||
| 76 | {AUDMGR_CB_PROG_VERS,0, "rs31000013:5fa922a9"}, | ||
| 77 | {AUDMGR_CB_VERS, 0x5fa922a9, ""}, | ||
| 78 | {TIME_REMOTE_MTOA_VERS, 0, ""}, | ||
| 79 | {RPC_TIME_TOD_SET_APPS_BASES, 2, ""}, | ||
| 80 | {PM_LIBVERS, 0x0, ""}, | ||
| 81 | {RPC_SND_VERS, 0x94756085, ""}, | ||
| 82 | {SND_SET_DEVICE_PROC, 2, ""}, | ||
| 83 | {SND_SET_VOLUME_PROC, 3, ""}, | ||
| 84 | {RPC_ADSP_RTOS_ATOM_PROG_VERS, 0, "rs3000000a:20f17fd3"}, | ||
| 85 | {RPC_ADSP_RTOS_ATOM_VERS, 0x20f17fd3, ""}, | ||
| 86 | {RPC_ADSP_RTOS_MTOA_VERS, 0x75babbd6, ""}, | ||
| 87 | {RPC_DOG_KEEPALIVE_BEACON, 1, ""}, | ||
| 88 | {DOG_KEEPALIVE_VERS, 0, ""}, | ||
| 89 | }; | ||
| 90 | |||
| 91 | struct amss_value amss_6220_para[] = { | ||
| 92 | {TIME_REMOTE_MTOA_VERS, 0x731fa727, ""}, | ||
| 93 | {RPC_TIME_TOD_SET_APPS_BASES, 2, ""}, | ||
| 94 | {PM_LIBVERS, 0xfb837d0b, ""}, | ||
| 95 | {RPC_ADSP_RTOS_ATOM_PROG_VERS, 0, "rs3000000a:71d1094b"}, | ||
| 96 | {RPC_ADSP_RTOS_ATOM_VERS, 0x71d1094b, ""}, | ||
| 97 | {RPC_ADSP_RTOS_MTOA_VERS, 0xee3a9966, ""}, | ||
| 98 | {RPC_DOG_KEEPALIVE_BEACON, 2, ""}, | ||
| 99 | {DOG_KEEPALIVE_VERS, 0x731fa727, ""}, | ||
| 100 | }; | ||
| 101 | |||
| 102 | |||
| 103 | struct amss_value amss_5200_para[] = { | ||
| 104 | {AUDMGR_PROG_VERS,0, "rs30000013:00000000"}, | ||
| 105 | {AUDMGR_VERS, 0x0, ""}, | ||
| 106 | {AUDMGR_CB_PROG_VERS,0, "rs31000013:5fa922a9"}, | ||
| 107 | {AUDMGR_CB_VERS, 0x5fa922a9, ""}, | ||
| 108 | {RPC_SND_VERS, 0x0, ""}, | ||
| 109 | {SND_SET_DEVICE_PROC, 1, ""}, | ||
| 110 | {SND_SET_VOLUME_PROC, 2, ""}, | ||
| 111 | {RPC_ADSP_RTOS_ATOM_PROG_VERS, 0, "rs3000000a:00000000"}, | ||
| 112 | {RPC_ADSP_RTOS_ATOM_VERS, 0x0, ""}, | ||
| 113 | {RPC_ADSP_RTOS_MTOA_VERS, 0x0, ""}, | ||
| 114 | }; | ||
| 115 | |||
| 116 | struct amss_value amss_6150_para[] = { | ||
| 117 | {AUDMGR_PROG_VERS,0, "rs30000013:00000000"}, | ||
| 118 | {AUDMGR_VERS, 0x0, ""}, | ||
| 119 | {RPC_ADSP_RTOS_ATOM_PROG_VERS, 0, "rs3000000a:00000000"}, | ||
| 120 | }; | ||
| 121 | |||
| 122 | // Function to init of the struct and get the Values, Init in first call. | ||
| 123 | |||
| 124 | int amss_get_value(int id, uint32_t numval, char* strval, size_t size) | ||
| 125 | { | ||
| 126 | static struct amss_value *active_para = NULL; | ||
| 127 | struct amss_value *mach_para; | ||
| 128 | static uint8_t init = 0, i; | ||
| 129 | uint32_t nbr_para = 0; | ||
| 130 | if(!init) { // First run, init the struct | ||
| 131 | pr_err("INIT AMSS PARA!, size: %d\n", sizeof(amss_def_para)); | ||
| 132 | // Initializes the default patameters | ||
| 133 | active_para = kmalloc(sizeof(amss_def_para), GFP_KERNEL); | ||
| 134 | memcpy(active_para, &amss_def_para, sizeof(amss_def_para)); | ||
| 135 | // Get the right struct | ||
| 136 | switch(__machine_arch_type) { | ||
| 137 | case MACH_TYPE_HTCTOPAZ: | ||
| 138 | case MACH_TYPE_HTCRHODIUM: | ||
| 139 | mach_para = amss_6120_para; | ||
| 140 | nbr_para = ARRAY_SIZE(amss_6120_para); | ||
| 141 | break; | ||
| 142 | case MACH_TYPE_HTCRAPHAEL: | ||
| 143 | case MACH_TYPE_HTCDIAMOND: | ||
| 144 | case MACH_TYPE_HTCBLACKSTONE: | ||
| 145 | mach_para = amss_5200_para; | ||
| 146 | nbr_para = ARRAY_SIZE(amss_5200_para); | ||
| 147 | break; | ||
| 148 | case MACH_TYPE_HTCRAPHAEL_CDMA: | ||
| 149 | case MACH_TYPE_HTCRAPHAEL_CDMA500: | ||
| 150 | case MACH_TYPE_HTCDIAMOND_CDMA: | ||
| 151 | mach_para = amss_6150_para; | ||
| 152 | nbr_para = ARRAY_SIZE(amss_6150_para); | ||
| 153 | break; | ||
| 154 | default: | ||
| 155 | printk(KERN_ERR "Unsupported device for adsp driver\n"); | ||
| 156 | strval = ""; | ||
| 157 | numval = 0; | ||
| 158 | return -ENODEV; | ||
| 159 | break; | ||
| 160 | } | ||
| 161 | // Set the versionspezificly values | ||
| 162 | for(i=0; i<nbr_para; i++) { | ||
| 163 | active_para[mach_para[i].id].numval = mach_para[i].numval; | ||
| 164 | active_para[mach_para[i].id].strval = kmalloc(sizeof(mach_para[i].strval)+1, GFP_KERNEL); | ||
| 165 | strcpy(active_para[mach_para[i].id].strval, mach_para[i].strval); | ||
| 166 | } | ||
| 167 | |||
| 168 | init = 1; | ||
| 169 | } | ||
| 170 | // Struct ready, get Value and exit | ||
| 171 | if(active_para[id].id != id) { // Check the array integrity | ||
| 172 | pr_err("AMSS Array mismatch! Check the parameters!\n"); | ||
| 173 | strval = ""; | ||
| 174 | numval = 0; | ||
| 175 | return -EINVAL; | ||
| 176 | } | ||
| 177 | |||
| 178 | numval = active_para[id].numval; | ||
| 179 | memcpy (strval, active_para[id].strval, size); | ||
| 180 | pr_err("AMSS ASK: %d GET: %x :%s\n", id, numval, strval); | ||
| 181 | |||
| 182 | return 0; | ||
| 183 | |||
| 184 | } | ||
| 185 | |||
| 186 | |||
| 187 | uint32_t amss_get_num_value(int id) | ||
| 188 | { | ||
| 189 | char* str = ""; | ||
| 190 | uint32_t num = 0; | ||
| 191 | amss_get_value(id, num, str, 0); | ||
| 192 | return num; | ||
| 193 | } | ||
| 194 | |||
| 195 | void amss_get_str_value(int id, char* str, size_t size) | ||
| 196 | { | ||
| 197 | uint32_t num = 0; | ||
| 198 | amss_get_value(id, num, str, size); | ||
| 199 | } | ||
| 200 |
arch/arm/mach-msm/qdsp5/audmgr.c
(11 / 4)
|   | |||
| 23 | 23 | ||
| 24 | 24 | #include <asm/atomic.h> | |
| 25 | 25 | #include <mach/msm_rpcrouter.h> | |
| 26 | #include <mach/amss_para.h> | ||
| 26 | 27 | ||
| 27 | 28 | #include "audmgr.h" | |
| 28 | 29 | ||
| … | … | ||
| 209 | 209 | if (am->state != STATE_CLOSED) | |
| 210 | 210 | return 0; | |
| 211 | 211 | ||
| 212 | am->ept = msm_rpc_connect(AUDMGR_PROG, AUDMGR_VERS, | ||
| 213 | MSM_RPC_UNINTERRUPTIBLE); | ||
| 212 | am->ept = msm_rpc_connect( | ||
| 213 | amss_get_num_value(AUDMGR_PROG), | ||
| 214 | amss_get_num_value(AUDMGR_VERS), | ||
| 215 | MSM_RPC_UNINTERRUPTIBLE); | ||
| 214 | 216 | init_waitqueue_head(&am->wait); | |
| 215 | 217 | ||
| 216 | 218 | if (IS_ERR(am->ept)) { | |
| … | … | ||
| 261 | 261 | msg.args.cb_func = cpu_to_be32(0x11111111); | |
| 262 | 262 | msg.args.client_data = cpu_to_be32(0x11223344); | |
| 263 | 263 | ||
| 264 | msm_rpc_setup_req(&msg.hdr, AUDMGR_PROG, AUDMGR_VERS, | ||
| 264 | msm_rpc_setup_req(&msg.hdr, | ||
| 265 | amss_get_num_value(AUDMGR_PROG), | ||
| 266 | amss_get_num_value(AUDMGR_VERS), | ||
| 265 | 267 | AUDMGR_ENABLE_CLIENT); | |
| 266 | 268 | ||
| 267 | 269 | rc = msm_rpc_write(am->ept, &msg, sizeof(msg)); | |
| … | … | ||
| 290 | 290 | if (am->state == STATE_DISABLED) | |
| 291 | 291 | return 0; | |
| 292 | 292 | ||
| 293 | msm_rpc_setup_req(&msg.hdr, AUDMGR_PROG, AUDMGR_VERS, | ||
| 293 | msm_rpc_setup_req(&msg.hdr, | ||
| 294 | amss_get_num_value(AUDMGR_PROG), | ||
| 295 | amss_get_num_value(AUDMGR_VERS), | ||
| 294 | 296 | AUDMGR_DISABLE_CLIENT); | |
| 295 | 297 | msg.handle = cpu_to_be32(am->handle); | |
| 296 | 298 |
arch/arm/mach-msm/qdsp5/audmgr.h
(0 / 38)
|   | |||
| 138 | 138 | //#define AUDMGR_GET_TX_SAMPLE_RATE 9 | |
| 139 | 139 | //#define AUDMGR_SET_DEVICE_MODE 10 | |
| 140 | 140 | ||
| 141 | #if CONFIG_MSM_AMSS_VERSION == 6120 | ||
| 142 | #define AUDMGR_PROG_VERS "rs30000013:00000000" | ||
| 143 | #define AUDMGR_PROG 0x30000013 | ||
| 144 | #define AUDMGR_VERS 0x0 | ||
| 145 | #elif CONFIG_MSM_AMSS_VERSION == 6210 | ||
| 146 | #define AUDMGR_PROG_VERS "rs30000013:46255756" | ||
| 147 | #define AUDMGR_PROG 0x30000013 | ||
| 148 | #define AUDMGR_VERS 0x46255756 | ||
| 149 | #elif CONFIG_MSM_AMSS_VERSION == 5200 | ||
| 150 | #define AUDMGR_PROG_VERS "rs30000013:00000000" | ||
| 151 | #define AUDMGR_PROG 0x30000013 | ||
| 152 | #define AUDMGR_VERS 0x0 | ||
| 153 | #elif CONFIG_MSM_AMSS_VERSION == 6150 /* TODO */ | ||
| 154 | #define AUDMGR_PROG_VERS "rs30000013:00000000" | ||
| 155 | #define AUDMGR_PROG 0x30000013 | ||
| 156 | #define AUDMGR_VERS 0x0 | ||
| 157 | #else | ||
| 158 | #define AUDMGR_PROG_VERS "rs30000013:e94e8f0c" | ||
| 159 | #define AUDMGR_PROG 0x30000013 | ||
| 160 | #define AUDMGR_VERS 0xe94e8f0c | ||
| 161 | #endif | ||
| 162 | 141 | ||
| 163 | 142 | struct rpc_audmgr_cb_func_ptr { | |
| 164 | 143 | uint32_t cb_id; | |
| … | … | ||
| 154 | 154 | #define AUDMGR_OPR_LSTNR_CB_FUNC_PTR 2 | |
| 155 | 155 | #define AUDMGR_CODEC_LSTR_FUNC_PTR 3 | |
| 156 | 156 | ||
| 157 | #if CONFIG_MSM_AMSS_VERSION == 6120 | ||
| 158 | #define AUDMGR_CB_PROG_VERS "rs31000013:00000000" | ||
| 159 | #define AUDMGR_CB_PROG 0x31000013 | ||
| 160 | #define AUDMGR_CB_VERS 0x00000000 | ||
| 161 | #elif CONFIG_MSM_AMSS_VERSION == 6210 | ||
| 162 | #define AUDMGR_CB_PROG_VERS "rs31000013:5fa922a9" | ||
| 163 | #define AUDMGR_CB_PROG 0x31000013 | ||
| 164 | #define AUDMGR_CB_VERS 0x5fa922a9 | ||
| 165 | #elif CONFIG_MSM_AMSS_VERSION == 5200 | ||
| 166 | #define AUDMGR_CB_PROG_VERS "rs31000013:00000000" | ||
| 167 | #define AUDMGR_CB_PROG 0x31000013 | ||
| 168 | #define AUDMGR_CB_VERS 0x0 | ||
| 169 | #else | ||
| 170 | #define AUDMGR_CB_PROG_VERS "rs31000013:21570ba7" | ||
| 171 | #define AUDMGR_CB_PROG 0x31000013 | ||
| 172 | #define AUDMGR_CB_VERS 0x21570ba7 | ||
| 173 | #endif | ||
| 174 | 157 | ||
| 175 | 158 | struct audmgr { | |
| 176 | 159 | wait_queue_head_t wait; |
arch/arm/mach-msm/qdsp5/snd.c
(16 / 97)
|   | |||
| 30 | 30 | #include <mach/msm_rpcrouter.h> | |
| 31 | 31 | #include <mach/htc_headset.h> | |
| 32 | 32 | #include <asm/mach-types.h> | |
| 33 | #include <mach/amss_para.h> | ||
| 33 | 34 | ||
| 34 | 35 | struct snd_ctxt { | |
| 35 | 36 | struct mutex lock; | |
| … | … | ||
| 43 | 43 | static int force_headset=0; | |
| 44 | 44 | module_param_named(force_headset, force_headset, int, S_IRUGO | S_IWUSR | S_IWGRP); | |
| 45 | 45 | ||
| 46 | #define RPC_SND_PROG 0x30000002 | ||
| 47 | 46 | ||
| 48 | #if CONFIG_MSM_AMSS_VERSION == 6210 | ||
| 49 | #define RPC_SND_VERS 0x94756085 /* 2490720389 */ | ||
| 50 | #define SND_SET_DEVICE_PROC 2 | ||
| 51 | #define SND_SET_VOLUME_PROC 3 | ||
| 52 | #elif (CONFIG_MSM_AMSS_VERSION == 6220) || (CONFIG_MSM_AMSS_VERSION == 6225) || (CONFIG_MSM_AMSS_VERSION == 6120) || (CONFIG_MSM_AMSS_VERSION == 6125) | ||
| 53 | #elif (CONFIG_MSM_AMSS_VERSION == 5200) || (CONFIG_MSM_AMSS_VERSION == 6150) | ||
| 54 | #endif | ||
| 55 | #define RPC_SND_VERS_6120 0xaa2b1a44 /* 2854951492 */ | ||
| 56 | #define SND_SET_DEVICE_PROC_6120 2 | ||
| 57 | #define SND_SET_VOLUME_PROC_6120 3 | ||
| 58 | #define RPC_SND_VERS_5200 0x0 | ||
| 59 | #define SND_SET_DEVICE_PROC_5200 1 | ||
| 60 | #define SND_SET_VOLUME_PROC_5200 2 | ||
| 61 | |||
| 62 | 47 | struct rpc_snd_set_device_args { | |
| 63 | 48 | uint32_t device; | |
| 64 | 49 | uint32_t ear_mute; | |
| … | … | ||
| 134 | 134 | pr_err("No sound endpoint found, can't set snd_device"); | |
| 135 | 135 | return; | |
| 136 | 136 | } | |
| 137 | switch(__machine_arch_type) { | ||
| 138 | case MACH_TYPE_HTCTOPAZ: | ||
| 139 | case MACH_TYPE_HTCRHODIUM: | ||
| 140 | msm_rpc_call(snd->ept, | ||
| 141 | SND_SET_DEVICE_PROC_6120, | ||
| 142 | &dmsg, sizeof(dmsg), 5 * HZ); | ||
| 143 | break; | ||
| 144 | case MACH_TYPE_HTCRAPHAEL: | ||
| 145 | case MACH_TYPE_HTCDIAMOND_CDMA: | ||
| 146 | case MACH_TYPE_HTCDIAMOND: | ||
| 147 | case MACH_TYPE_HTCBLACKSTONE: | ||
| 148 | case MACH_TYPE_HTCRAPHAEL_CDMA: | ||
| 149 | msm_rpc_call(snd->ept, | ||
| 150 | SND_SET_DEVICE_PROC_5200, | ||
| 151 | &dmsg, sizeof(dmsg), 5 * HZ); | ||
| 152 | break; | ||
| 153 | default: | ||
| 154 | printk(KERN_ERR "Unsupported device for snd_set_device driver\n"); | ||
| 155 | break; | ||
| 156 | } | ||
| 137 | msm_rpc_call(snd->ept, | ||
| 138 | amss_get_num_value(SND_SET_DEVICE_PROC), | ||
| 139 | &dmsg, sizeof(dmsg), 5 * HZ); | ||
| 140 | |||
| 157 | 141 | } | |
| 158 | 142 | EXPORT_SYMBOL(snd_set_device); | |
| 159 | 143 | ||
| … | … | ||
| 188 | 188 | ||
| 189 | 189 | pr_info("snd_set_device %d %d %d\n", dev.device, | |
| 190 | 190 | dev.ear_mute, dev.mic_mute); | |
| 191 | switch(__machine_arch_type) { | ||
| 192 | case MACH_TYPE_HTCTOPAZ: | ||
| 193 | case MACH_TYPE_HTCRHODIUM: | ||
| 194 | rc = msm_rpc_call(snd->ept, | ||
| 195 | SND_SET_DEVICE_PROC_6120, | ||
| 196 | &dmsg, sizeof(dmsg), 5 * HZ); | ||
| 197 | break; | ||
| 198 | case MACH_TYPE_HTCRAPHAEL: | ||
| 199 | case MACH_TYPE_HTCDIAMOND_CDMA: | ||
| 200 | case MACH_TYPE_HTCDIAMOND: | ||
| 201 | case MACH_TYPE_HTCBLACKSTONE: | ||
| 202 | case MACH_TYPE_HTCRAPHAEL_CDMA: | ||
| 203 | rc = msm_rpc_call(snd->ept, | ||
| 204 | SND_SET_DEVICE_PROC_5200, | ||
| 205 | &dmsg, sizeof(dmsg), 5 * HZ); | ||
| 206 | break; | ||
| 207 | default: | ||
| 208 | printk(KERN_ERR "Unsupported device for snd_set_device driver\n"); | ||
| 209 | rc = -ENODEV; | ||
| 210 | break; | ||
| 211 | } | ||
| 191 | rc = msm_rpc_call(snd->ept, | ||
| 192 | amss_get_num_value(SND_SET_DEVICE_PROC), | ||
| 193 | &dmsg, sizeof(dmsg), 5 * HZ); | ||
| 212 | 194 | ||
| 213 | 195 | break; | |
| 214 | 196 | ||
| … | … | ||
| 237 | 237 | pr_info("snd_set_volume %d %d %d\n", vol.device, | |
| 238 | 238 | vol.method, vol.volume); | |
| 239 | 239 | ||
| 240 | switch(__machine_arch_type) { | ||
| 241 | case MACH_TYPE_HTCTOPAZ: | ||
| 242 | case MACH_TYPE_HTCRHODIUM: | ||
| 243 | rc = msm_rpc_call(snd->ept, | ||
| 244 | SND_SET_VOLUME_PROC_6120, | ||
| 245 | &vmsg, sizeof(vmsg), 5 * HZ); | ||
| 246 | break; | ||
| 247 | case MACH_TYPE_HTCRAPHAEL: | ||
| 248 | case MACH_TYPE_HTCDIAMOND_CDMA: | ||
| 249 | case MACH_TYPE_HTCDIAMOND: | ||
| 250 | case MACH_TYPE_HTCBLACKSTONE: | ||
| 251 | case MACH_TYPE_HTCRAPHAEL_CDMA: | ||
| 252 | rc = msm_rpc_call(snd->ept, | ||
| 253 | SND_SET_VOLUME_PROC_5200, | ||
| 254 | &vmsg, sizeof(vmsg), 5 * HZ); | ||
| 255 | break; | ||
| 256 | default: | ||
| 257 | printk(KERN_ERR "Unsupported device for snd_set_device driver\n"); | ||
| 258 | rc = -ENODEV; | ||
| 259 | break; | ||
| 260 | } | ||
| 261 | break; | ||
| 240 | rc = msm_rpc_call(snd->ept, | ||
| 241 | amss_get_num_value(SND_SET_VOLUME_PROC), | ||
| 242 | &vmsg, sizeof(vmsg), 5 * HZ); | ||
| 262 | 243 | ||
| 244 | |||
| 263 | 245 | case SND_GET_NUM_ENDPOINTS: | |
| 264 | 246 | if (copy_to_user((void __user *)arg, | |
| 265 | 247 | &snd->snd_epts->num, sizeof(unsigned))) { | |
| … | … | ||
| 282 | 282 | mutex_lock(&snd->lock); | |
| 283 | 283 | if (snd->opened == 0) { | |
| 284 | 284 | if (snd->ept == NULL) { | |
| 285 | switch(__machine_arch_type) { | ||
| 286 | case MACH_TYPE_HTCTOPAZ: | ||
| 287 | case MACH_TYPE_HTCRHODIUM: | ||
| 288 | snd->ept = msm_rpc_connect(RPC_SND_PROG, RPC_SND_VERS_6120, | ||
| 289 | MSM_RPC_UNINTERRUPTIBLE); | ||
| 290 | break; | ||
| 291 | case MACH_TYPE_HTCRAPHAEL: | ||
| 292 | case MACH_TYPE_HTCDIAMOND_CDMA: | ||
| 293 | case MACH_TYPE_HTCDIAMOND: | ||
| 294 | case MACH_TYPE_HTCBLACKSTONE: | ||
| 295 | case MACH_TYPE_HTCRAPHAEL_CDMA: | ||
| 296 | snd->ept = msm_rpc_connect(RPC_SND_PROG, RPC_SND_VERS_5200, | ||
| 297 | MSM_RPC_UNINTERRUPTIBLE); | ||
| 298 | break; | ||
| 299 | default: | ||
| 300 | printk(KERN_ERR "Unsupported device for qdsp/snd driver\n"); | ||
| 301 | return -1; | ||
| 302 | break; | ||
| 303 | } | ||
| 285 | snd->ept = msm_rpc_connect( | ||
| 286 | amss_get_num_value(RPC_SND_PROG), | ||
| 287 | amss_get_num_value(RPC_SND_VERS), | ||
| 288 | MSM_RPC_UNINTERRUPTIBLE); | ||
| 304 | 289 | if (IS_ERR(snd->ept)) { | |
| 305 | 290 | rc = PTR_ERR(snd->ept); | |
| 306 | 291 | snd->ept = NULL; |
|   | |||
| 17 | 17 | #include <linux/module.h> | |
| 18 | 18 | #include <linux/kernel.h> | |
| 19 | 19 | #include <mach/msm_rpcrouter.h> | |
| 20 | #include <mach/amss_para.h> | ||
| 20 | 21 | ||
| 21 | 22 | /* dog_keepalive server definitions */ | |
| 22 | 23 | ||
| 23 | #define DOG_KEEPALIVE_PROG 0x30000015 | ||
| 24 | #define RPC_DOG_KEEPALIVE_NULL 0 | ||
| 25 | 24 | ||
| 26 | #if CONFIG_MSM_AMSS_VERSION==6210 | ||
| 27 | #define DOG_KEEPALIVE_VERS 0 | ||
| 28 | #define RPC_DOG_KEEPALIVE_BEACON 1 | ||
| 29 | #elif (CONFIG_MSM_AMSS_VERSION==6220) || (CONFIG_MSM_AMSS_VERSION==6225) | ||
| 30 | #define DOG_KEEPALIVE_VERS 0x731fa727 | ||
| 31 | #define RPC_DOG_KEEPALIVE_BEACON 2 | ||
| 32 | #else | ||
| 33 | #error "Unsupported AMSS version" | ||
| 34 | #endif | ||
| 35 | |||
| 36 | 25 | static int handle_rpc_call(struct msm_rpc_server *server, | |
| 37 | 26 | struct rpc_request_hdr *req, unsigned len) | |
| 38 | 27 | { | |
| 39 | switch (req->procedure) { | ||
| 40 | case RPC_DOG_KEEPALIVE_NULL: | ||
| 28 | if (req->procedure == amss_get_num_value(RPC_DOG_KEEPALIVE_NULL)) | ||
| 41 | 29 | return 0; | |
| 42 | case RPC_DOG_KEEPALIVE_BEACON: | ||
| 30 | else if (req->procedure == amss_get_num_value(RPC_DOG_KEEPALIVE_BEACON)) { | ||
| 43 | 31 | printk(KERN_INFO "DOG KEEPALIVE PING\n"); | |
| 44 | 32 | return 0; | |
| 45 | default: | ||
| 46 | return -ENODEV; | ||
| 47 | 33 | } | |
| 34 | else | ||
| 35 | return -ENODEV; | ||
| 36 | |||
| 48 | 37 | } | |
| 49 | 38 | ||
| 50 | 39 | static struct msm_rpc_server rpc_server = { | |
| 51 | .prog = DOG_KEEPALIVE_PROG, | ||
| 52 | .vers = DOG_KEEPALIVE_VERS, | ||
| 53 | 40 | .rpc_call = handle_rpc_call, | |
| 54 | 41 | }; | |
| 55 | 42 | ||
| 56 | 43 | static int __init rpc_server_init(void) | |
| 57 | 44 | { | |
| 45 | rpc_server.prog = amss_get_num_value(DOG_KEEPALIVE_PROG); | ||
| 46 | rpc_server.vers = amss_get_num_value(DOG_KEEPALIVE_VERS); | ||
| 58 | 47 | return msm_rpc_create_server(&rpc_server); | |
| 59 | 48 | } | |
| 60 | 49 |
|   | |||
| 17 | 17 | #include <linux/module.h> | |
| 18 | 18 | #include <linux/kernel.h> | |
| 19 | 19 | #include <mach/msm_rpcrouter.h> | |
| 20 | #include <mach/amss_para.h> | ||
| 20 | 21 | ||
| 21 | 22 | /* time_remote_mtoa server definitions. */ | |
| 22 | 23 | ||
| 23 | #define TIME_REMOTE_MTOA_PROG 0x3000005d | ||
| 24 | #define RPC_TIME_REMOTE_MTOA_NULL 0 | ||
| 25 | 24 | ||
| 26 | #if CONFIG_MSM_AMSS_VERSION==6210 | ||
| 27 | #define TIME_REMOTE_MTOA_VERS 0 | ||
| 28 | #define RPC_TIME_TOD_SET_APPS_BASES 2 | ||
| 29 | #elif (CONFIG_MSM_AMSS_VERSION==6220) || (CONFIG_MSM_AMSS_VERSION==6225) | ||
| 30 | #define TIME_REMOTE_MTOA_VERS 0x9202a8e4 | ||
| 31 | #define RPC_TIME_TOD_SET_APPS_BASES 2 | ||
| 32 | #elif defined(CONFIG_MSM_AMSS_VERSION_WINCE) | ||
| 33 | #define TIME_REMOTE_MTOA_VERS 0 | ||
| 34 | #define RPC_TIME_TOD_SET_APPS_BASES 1 | ||
| 35 | #else | ||
| 36 | #error "Unknown AMSS version" | ||
| 37 | #endif | ||
| 38 | |||
| 39 | 25 | struct rpc_time_tod_set_apps_bases_args { | |
| 40 | 26 | uint32_t tick; | |
| 41 | 27 | uint64_t stamp; | |
| … | … | ||
| 30 | 30 | static int handle_rpc_call(struct msm_rpc_server *server, | |
| 31 | 31 | struct rpc_request_hdr *req, unsigned len) | |
| 32 | 32 | { | |
| 33 | switch (req->procedure) { | ||
| 34 | case RPC_TIME_REMOTE_MTOA_NULL: | ||
| 33 | if (req->procedure == amss_get_num_value(RPC_TIME_REMOTE_MTOA_NULL)) | ||
| 35 | 34 | return 0; | |
| 36 | |||
| 37 | case RPC_TIME_TOD_SET_APPS_BASES: { | ||
| 35 | else if (req->procedure == amss_get_num_value(RPC_TIME_TOD_SET_APPS_BASES)) { | ||
| 38 | 36 | struct rpc_time_tod_set_apps_bases_args *args; | |
| 39 | 37 | args = (struct rpc_time_tod_set_apps_bases_args *)(req + 1); | |
| 40 | 38 | args->tick = be32_to_cpu(args->tick); | |
| … | … | ||
| 43 | 43 | args->tick, args->stamp); | |
| 44 | 44 | return 0; | |
| 45 | 45 | } | |
| 46 | default: | ||
| 46 | else | ||
| 47 | 47 | return -ENODEV; | |
| 48 | } | ||
| 49 | 48 | } | |
| 50 | 49 | ||
| 51 | 50 | static struct msm_rpc_server rpc_server = { | |
| 52 | .prog = TIME_REMOTE_MTOA_PROG, | ||
| 53 | .vers = TIME_REMOTE_MTOA_VERS, | ||
| 54 | 51 | .rpc_call = handle_rpc_call, | |
| 55 | 52 | }; | |
| 56 | 53 | ||
| 57 | 54 | static int __init rpc_server_init(void) | |
| 58 | 55 | { | |
| 56 | rpc_server.prog = amss_get_num_value(TIME_REMOTE_MTOA_PROG); | ||
| 57 | rpc_server.vers = amss_get_num_value(TIME_REMOTE_MTOA_VERS); | ||
| 58 | |||
| 59 | 59 | return msm_rpc_create_server(&rpc_server); | |
| 60 | 60 | } | |
| 61 | 61 |

