Share Pastebin
Guest
Public paste!

MrPippy

By: a guest | Feb 16th, 2010 | Syntax: None | Size: 1.31 KB | Hits: 43 | Expires: Never
Copy text to clipboard
  1. diff --git a/arch/arm/mach-msm/htc_acoustic.c b/arch/arm/mach-msm/htc_acoustic.c
  2. index ebd4de7..96d39d1 100644
  3. --- a/arch/arm/mach-msm/htc_acoustic.c
  4. +++ b/arch/arm/mach-msm/htc_acoustic.c
  5.  -67,7 +67,7 @@ struct set_acoustic_rep {
  6.  };
  7.  
  8.  static uint32_t htc_acoustic_vir_addr;
  9. -static struct msm_rpc_endpoint *endpoint;
  10. +static struct msm_rpc_endpoint *endpoint = NULL;
  11.  static struct mutex api_lock;
  12.  static struct mutex rpc_connect_mutex;
  13.  static unsigned int mic_offset;
  14.  -84,6 +84,25 @@ int turn_mic_bias_on(int on)
  15.         *(unsigned *)(MSM_SHARED_RAM_BASE+mic_offset)=0xffff0080 | (on?0x100:0);
  16.         dex.data=0x10;
  17.         msm_proc_comm_wince(&dex,0);
  18. +
  19. +       {
  20. +               int ret;
  21. +               struct {
  22. +                       struct rpc_request_hdr hdr;
  23. +                       uint32_t data;
  24. +               } req;
  25. +
  26. +               if (!endpoint)
  27. +                       endpoint = msm_rpc_connect(0x30000061, 0x0, 0);
  28. +               if (!endpoint) {
  29. +                       printk("Couldn't open rpc endpoint\n");
  30. +                       return -EIO;
  31. +               }
  32. +               req.data=cpu_to_be32(0x1);
  33. +               ret = msm_rpc_call(endpoint, 0x1c, &req, sizeof(req), 5 * HZ);
  34. +               printk("mic bias rpc ret %d\n", ret);
  35. +       }
  36. +
  37.         return 0;
  38.  }