SHARE
TWEET

Untitled

a guest May 23rd, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Copyright (C) 2015 MediaTek Inc.
  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 as
  6.  * 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 _KD_CAMERA_HW_H_
  15. #define _KD_CAMERA_HW_H_
  16.  
  17. #include <linux/types.h>
  18.  
  19.  
  20. #if defined CONFIG_MTK_LEGACY
  21. #include <mach/mt_gpio.h>
  22. #include <mach/mt_pm_ldo.h>
  23. #include "pmic_drv.h"
  24.  
  25. #ifndef FALSE
  26.   #define FALSE (0)
  27. #endif
  28.  
  29. #ifndef TRUE
  30.   #define TRUE  (1)
  31. #endif
  32.  
  33. /*  */
  34. /* Analog */
  35. #define CAMERA_POWER_VCAM_A         PMIC_APP_MAIN_CAMERA_POWER_A
  36. /* Digital */
  37. #define CAMERA_POWER_VCAM_D         PMIC_APP_MAIN_CAMERA_POWER_D
  38. /* AF */
  39. #define CAMERA_POWER_VCAM_AF        PMIC_APP_MAIN_CAMERA_POWER_AF
  40. /* digital io */
  41. #define CAMERA_POWER_VCAM_IO        PMIC_APP_MAIN_CAMERA_POWER_IO
  42. /* Digital for Sub */
  43. #define SUB_CAMERA_POWER_VCAM_D     PMIC_APP_SUB_CAMERA_POWER_D
  44.  
  45. /* FIXME, should defined in DCT tool */
  46. /* Main sensor */
  47. #define CAMERA_CMRST_PIN            GPIO_CAMERA_CMRST_PIN
  48. #define CAMERA_CMRST_PIN_M_GPIO     GPIO_CAMERA_CMRST_PIN_M_GPIO
  49.  
  50. #define CAMERA_CMPDN_PIN            GPIO_CAMERA_CMPDN_PIN
  51. #define CAMERA_CMPDN_PIN_M_GPIO     GPIO_CAMERA_CMPDN_PIN_M_GPIO
  52.  
  53. /* FRONT sensor */
  54. #define CAMERA_CMRST1_PIN           GPIO_CAMERA_CMRST1_PIN
  55. #define CAMERA_CMRST1_PIN_M_GPIO    GPIO_CAMERA_CMRST1_PIN_M_GPIO
  56.  
  57. #define CAMERA_CMPDN1_PIN           GPIO_CAMERA_CMPDN1_PIN
  58. #define CAMERA_CMPDN1_PIN_M_GPIO    GPIO_CAMERA_CMPDN1_PIN_M_GPIO
  59.  
  60. /* Define I2C Bus Num */
  61. #define SUPPORT_I2C_BUS_NUM1        0
  62. #define SUPPORT_I2C_BUS_NUM2        0
  63. #else
  64. #define CAMERA_CMRST_PIN            0
  65. #define CAMERA_CMRST_PIN_M_GPIO     0
  66.  
  67. #define CAMERA_CMPDN_PIN            0
  68. #define CAMERA_CMPDN_PIN_M_GPIO     0
  69.  
  70. /* FRONT sensor */
  71. #define CAMERA_CMRST1_PIN           0
  72. #define CAMERA_CMRST1_PIN_M_GPIO    0
  73.  
  74. #define CAMERA_CMPDN1_PIN           0
  75. #define CAMERA_CMPDN1_PIN_M_GPIO    0
  76.  
  77. #define GPIO_OUT_ONE 1
  78. #define GPIO_OUT_ZERO 0
  79.  
  80. #endif /* End of #if defined CONFIG_MTK_LEGACY */
  81.  
  82.  
  83. typedef enum KD_REGULATOR_TYPE_TAG {
  84.     VCAMA,
  85.     VCAMD,
  86.     VCAMIO,
  87.     VCAMAF,
  88. } KD_REGULATOR_TYPE_T;
  89.  
  90. typedef enum {
  91.     CAMPDN,
  92.     CAMRST,
  93.     CAM1PDN,
  94.     CAM1RST,
  95.     CAMDLDO,
  96.     CAMALDO
  97. } CAMPowerType;
  98.  
  99. extern void ISP_MCLK1_EN(bool En);
  100. extern void ISP_MCLK2_EN(bool En);
  101. extern void ISP_MCLK3_EN(bool En);
  102.  
  103. extern bool _hwPowerDown(KD_REGULATOR_TYPE_T type);
  104. extern bool _hwPowerOn(KD_REGULATOR_TYPE_T type, int powerVolt);
  105.  
  106. int mtkcam_gpio_set(int PinIdx, int PwrType, int Val);
  107. int mtkcam_gpio_init(struct platform_device *pdev);
  108.  
  109. #endif
  110.  
  111. /* sanford.lin add start on 20160122*/
  112. #define VOL_2800 2800000
  113. #define VOL_1800 1800000
  114. #define VOL_1500 1500000
  115. #define VOL_1200 1200000
  116. #define VOL_1000 1000000
  117.  
  118. typedef enum{
  119.     VDD_None = 0,
  120.     SensorId = 0xf1,
  121.     SensorMCLK = 0xf2,
  122.     PDN = 0xf3,
  123.     RST = 0xf4,
  124.     AVDD = 0xf5,
  125.     DVDD = 0xf6,
  126.     DOVDD = 0xf7,
  127.     AFVDD = 0xf8
  128. }PowerType;
  129.  
  130. typedef enum{
  131.     MAIN_SENSOR = 0,
  132.     SUB_SENSOR = 1,
  133.     MAIN_2_SENSOR = 2,
  134.     Mclk1 = 0xf1,
  135.     Mclk2 = 0xf2,
  136.     Vol_Low = 0xf3,
  137.     Vol_High = 0xf4,
  138.     Vol_1000 = VOL_1000,
  139.     Vol_1200 = VOL_1200,
  140.     Vol_1500 = VOL_1500,
  141.     Vol_1800 = VOL_1800,
  142.     Vol_2800 = VOL_2800
  143. }Voltage;
  144.  
  145. typedef struct{
  146.     PowerType PowerType;
  147.     Voltage Voltage;
  148.     u32 Delay;
  149. }PowerInformation;
  150.  
  151. typedef struct{
  152.     char* SensorName;
  153.     PowerInformation PowerInfo[15];
  154. }PowerSequence;
  155.  
  156. typedef struct{
  157.     PowerSequence PowerSeq[16];
  158. }PowerUp;
  159.  
  160. /* sanford.lin add end on 20160122*/
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top