Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merged with EasyPad 971 kernel snapshot

  • Loading branch information...
commit 0d083e144bf38f207deb9563cec7e4ce8434552a 1 parent adaa7cc
omegamoon authored
Showing with 30,942 additions and 351 deletions.
  1. +2 −0  README.md
  2. +26 −33 arch/arm/configs/mk808_defconfig
  3. +3 −2 drivers/adc/core.c
  4. +1 −1  drivers/adc/plat/rk29_adc.c
  5. +6 −12 drivers/adc/plat/rk30_adc.c
  6. +11 −0 drivers/bluetooth/Kconfig
  7. +7 −16 drivers/gpio/gpiolib.c
  8. +3 −2 drivers/i2c/busses/Kconfig
  9. +1 −1  drivers/i2c/busses/i2c-rk30.c
  10. +6 −0 drivers/input/touchscreen/Kconfig
  11. +2 −0  drivers/input/touchscreen/Makefile
  12. +703 −0 drivers/input/touchscreen/ct36x_ts.c
  13. +2,048 −0 drivers/input/touchscreen/ts36100.dat
  14. +41 −1 drivers/media/video/Kconfig
  15. +4 −0 drivers/media/video/Makefile
  16. +3,046 −0 drivers/media/video/gc0329.c
  17. +1 −1  drivers/media/video/ov2659.c
  18. +1 −1  drivers/media/video/ov5640.c
  19. +3 −0  drivers/media/video/ov5640_for_td8801.c
  20. +42 −35 drivers/media/video/rk29_camera_oneframe.c
  21. +1 −1  drivers/media/video/rk30_camera.c
  22. +84 −81 drivers/media/video/rk30_camera_oneframe.c
  23. +6,093 −0 drivers/media/video/s5k5ca.c
  24. +242 −0 drivers/media/video/s5k5ca.h
  25. +715 −4 drivers/media/video/sid130B.c
  26. +2,728 −0 drivers/media/video/siv121d.c
  27. +2,884 −0 drivers/media/video/sp0838.c
  28. +17 −0 drivers/mfd/wm831x-core.c
  29. +31 −0 drivers/misc/3g_module/Kconfig
  30. +6 −0 drivers/misc/3g_module/Makefile
  31. +352 −0 drivers/misc/3g_module/mi700.c
  32. 0  drivers/misc/{ → 3g_module}/mt6229.c
  33. 0  drivers/misc/{ → 3g_module}/mu509.c
  34. 0  drivers/misc/{ → 3g_module}/mw100.c
  35. +228 −0 drivers/misc/3g_module/sew868.c
  36. 0  drivers/misc/{ → 3g_module}/ste.c
  37. +1 −11 drivers/misc/Kconfig
  38. +1 −4 drivers/misc/Makefile
  39. +18 −58 drivers/misc/gps/rk29_gps.c
  40. +2 −0  drivers/mtd/rknand/rknand_base.h
  41. +23 −5 drivers/mtd/rknand/rknand_base_ko.c
  42. +8 −1 drivers/power/Kconfig
  43. +4 −0 drivers/power/Makefile
  44. +375 −0 drivers/power/oz8806_battery.c
  45. +98 −0 drivers/power/parameter.c
  46. +132 −0 drivers/power/parameter.h
  47. +6 −1 drivers/usb/gadget/epautoconf.c
  48. +1 −1  drivers/usb/gadget/f_adb.c
  49. +1 −1  drivers/usb/gadget/storage_common.c
  50. +8 −0 drivers/usb/serial/Kconfig
  51. +1 −0  drivers/usb/serial/Makefile
  52. +29 −1 drivers/usb/serial/option.c
  53. +14 −0 drivers/usb/serial/usb-serial.c
  54. +83 −0 drivers/usb/serial/usiserial.c
  55. +4 −0 drivers/video/backlight/rk2818_backlight.h
  56. +2 −0  drivers/video/display/screen/Kconfig
  57. +2 −1  drivers/video/display/screen/Makefile
  58. +76 −0 drivers/video/display/screen/lcd_hv070wsa.c
  59. +6 −4 drivers/video/hdmi/Kconfig
  60. +5 −0 drivers/video/hdmi/chips/Kconfig
  61. +2 −2 drivers/video/hdmi/chips/Makefile
  62. +2 −1  drivers/video/hdmi/chips/{ → anx7150}/anx7150.c
  63. 0  drivers/video/hdmi/chips/{ → anx7150}/anx7150.h
  64. 0  drivers/video/hdmi/chips/{ → anx7150}/anx7150_hw.c
  65. 0  drivers/video/hdmi/chips/{ → anx7150}/anx7150_hw.h
  66. +304 −0 drivers/video/hdmi/chips/rk610/rk610_hdmi.c
  67. +36 −0 drivers/video/hdmi/chips/rk610/rk610_hdmi.h
  68. +1,271 −0 drivers/video/hdmi/chips/rk610/rk610_hdmi_hw.c
  69. +258 −0 drivers/video/hdmi/chips/rk610/rk610_hdmi_hw.h
  70. +6 −0 drivers/video/hdmi/hdmi-backlight.c
  71. +1 −1  drivers/video/hdmi/hdmi-codec.c
  72. +13 −7 drivers/video/hdmi/hdmi-core.c
  73. +20 −12 drivers/video/hdmi/hdmi-fb.c
  74. +1 −1  fs/fat/fatent.c
  75. +12 −1 include/linux/adc.h
  76. +58 −38 include/linux/mfd/rk610_core.h
  77. +2 −2 include/linux/mfd/tps65910.h
  78. +2 −0  include/linux/mfd/wm831x/core.h
  79. +27 −0 include/linux/mi700.h
  80. +1 −1  include/linux/mma7660.h
  81. +25 −0 include/linux/sew868.h
  82. +5 −0 include/media/v4l2-chip-ident.h
  83. +1 −1  kernel/power/wakelock.c
  84. +1 −1  kernel/sched.c
  85. +7 −1 net/rfkill/rfkill-rk.c
  86. +1 −0  scripts/pnmtologo.c
  87. +8 −0 sound/soc/codecs/Kconfig
  88. +4 −1 sound/soc/codecs/Makefile
  89. +9 −0 sound/soc/codecs/rk610_codec.c
  90. +1,400 −0 sound/soc/codecs/rt3261-dsp.c
  91. +39 −0 sound/soc/codecs/rt3261-dsp.h
  92. +3,144 −0 sound/soc/codecs/rt3261.c
  93. +2,151 −0 sound/soc/codecs/rt3261.h
  94. +485 −0 sound/soc/codecs/rt3261_ioctl.c
  95. +41 −0 sound/soc/codecs/rt3261_ioctl.h
  96. +314 −0 sound/soc/codecs/rt5623.c
  97. +506 −0 sound/soc/codecs/rt5623.h
  98. +23 −1 sound/soc/codecs/rt5631.c
  99. +179 −0 sound/soc/codecs/rt_codec_ioctl.c
  100. +78 −0 sound/soc/codecs/rt_codec_ioctl.h
  101. +18 −1 sound/soc/rk29/Kconfig
  102. +2 −0  sound/soc/rk29/Makefile
  103. +247 −0 sound/soc/rk29/rk29_rt3261.c
2  README.md
View
@@ -20,3 +20,5 @@ Linux kernel release 3.x for Rockchip RK3066 - www.omegamoon.com
- Added mk808 build script
- Added linux flash tools + flash script for mk808 (use at own risk!)
- Updated README and added build- and flash instructions
+
+- Merged with EasyPad 971 kernel snapshot (i97-8326-1.5)
59 arch/arm/configs/mk808_defconfig
View
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Linux/arm 3.0.8+ Kernel Configuration
+# Linux/arm 3.0.8 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -869,6 +869,7 @@ CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
+# CONFIG_BT_HIDP is not set
#
# Bluetooth device drivers
@@ -1065,8 +1066,6 @@ CONFIG_APANIC_PLABEL="kpanic"
# CONFIG_STE is not set
# CONFIG_MTK23D is not set
# CONFIG_FM580X is not set
-# CONFIG_MU509 is not set
-# CONFIG_MW100 is not set
# CONFIG_RK29_NEWTON is not set
# CONFIG_RK29_SC8800 is not set
# CONFIG_TDSC8800 is not set
@@ -1090,6 +1089,7 @@ CONFIG_APANIC_PLABEL="kpanic"
#
# CONFIG_TI_ST is not set
# CONFIG_SENSORS_LIS3_I2C is not set
+# CONFIG_3G_MODULE is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set
@@ -1485,7 +1485,6 @@ CONFIG_I2C4_RK30=y
# CONFIG_I2C4_CONTROLLER_RK29 is not set
CONFIG_I2C4_CONTROLLER_RK30=y
# CONFIG_I2C_GPIO_RK30 is not set
-CONFIG_I2C_DEV_RK29=y
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
@@ -1572,11 +1571,15 @@ CONFIG_TEST_POWER=y
# CONFIG_BATTERY_BQ27x00 is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_BATTERY_OZ8806 is not set
# CONFIG_CHARGER_MAX8903 is not set
# CONFIG_CHARGER_GPIO is not set
+# CONFIG_BATTERY_RK29_ADC is not set
# CONFIG_BATTERY_RK30_ADC is not set
+# CONFIG_BATTERY_TYPE is not set
# CONFIG_POWER_ON_CHARGER_DISPLAY is not set
# CONFIG_WM8326_VBAT_LOW_DETECTION is not set
+# CONFIG_TWL60xx_VBAT_LOW_DETECTION is not set
# CONFIG_HWMON is not set
# CONFIG_THERMAL is not set
# CONFIG_WATCHDOG is not set
@@ -1945,6 +1948,7 @@ CONFIG_DISPLAY_SUPPORT=y
# CONFIG_LCD_HSD100PXN is not set
# CONFIG_LCD_HSD07PFW1 is not set
# CONFIG_LCD_BYD8688FTGF is not set
+# CONFIG_LCD_TQ7025 is not set
# CONFIG_LCD_B101AW06 is not set
# CONFIG_LCD_LS035Y8DX02A is not set
# CONFIG_LCD_LS035Y8DX04A is not set
@@ -1967,6 +1971,7 @@ CONFIG_DISPLAY_SUPPORT=y
# CONFIG_BOX_FB_480P is not set
# CONFIG_BOX_FB_720P is not set
CONFIG_BOX_FB_1080P=y
+# CONFIG_LCD_HV070WSA100 is not set
# CONFIG_DISPLAY_LCD_SUPPORT is not set
# CONFIG_HDMI_ITV is not set
# CONFIG_RK_VGA is not set
@@ -2042,8 +2047,10 @@ CONFIG_SND_DMA_EVENT_STATIC=y
# CONFIG_SND_RK29_SOC_WM8988 is not set
# CONFIG_SND_RK29_SOC_WM8900 is not set
# CONFIG_SND_RK29_SOC_RT5621 is not set
+# CONFIG_SND_RK29_SOC_RT5623 is not set
# CONFIG_SND_RK29_SOC_RT5631 is not set
# CONFIG_SND_RK29_SOC_RT5625 is not set
+# CONFIG_SND_RK29_SOC_RT3261 is not set
# CONFIG_SND_RK29_SOC_CS42L52 is not set
# CONFIG_SND_RK29_SOC_AIC3111 is not set
# CONFIG_SND_RK29_SOC_AIC3262 is not set
@@ -2056,15 +2063,16 @@ CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_ALL_CODECS is not set
CONFIG_SND_SOC_RK_HDMI_CODEC=y
# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HIDRAW is not set
#
-# HID support
+# USB Input Devices
#
-CONFIG_HID=y
-# CONFIG_HID_BATTERY_STRENGTH is not set
-# CONFIG_HIDRAW is not set
-# CONFIG_UHID is not set
-CONFIG_HID_GENERIC=y
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
#
# Special HID drivers
@@ -2073,7 +2081,6 @@ CONFIG_HID_A4TECH=y
CONFIG_HID_ACRUX=y
CONFIG_HID_ACRUX_FF=y
CONFIG_HID_APPLE=y
-# CONFIG_HID_AUREAL is not set
CONFIG_HID_BELKIN=y
CONFIG_HID_CHERRY=y
CONFIG_HID_CHICONY=y
@@ -2083,7 +2090,6 @@ CONFIG_HID_DRAGONRISE=y
CONFIG_DRAGONRISE_FF=y
CONFIG_HID_EMS_FF=y
CONFIG_HID_EZKEY=y
-# CONFIG_HID_HOLTEK is not set
CONFIG_HID_KEYTOUCH=y
CONFIG_HID_KYE=y
CONFIG_HID_UCLOGIC=y
@@ -2092,13 +2098,11 @@ CONFIG_HID_GYRATION=y
CONFIG_HID_TWINHAN=y
CONFIG_HID_KENSINGTON=y
CONFIG_HID_LCPOWER=y
-# CONFIG_HID_LENOVO_TPKBD is not set
CONFIG_HID_LOGITECH=y
-# CONFIG_HID_LOGITECH_DJ is not set
CONFIG_LOGITECH_FF=y
CONFIG_LOGIRUMBLEPAD2_FF=y
CONFIG_LOGIG940_FF=y
-CONFIG_LOGIWHEELS_FF=y
+# CONFIG_LOGIWII_FF is not set
CONFIG_HID_MICROSOFT=y
CONFIG_HID_MONTEREY=y
CONFIG_HID_MULTITOUCH=y
@@ -2111,38 +2115,26 @@ CONFIG_HID_PICOLCD=y
# CONFIG_HID_PICOLCD_FB is not set
# CONFIG_HID_PICOLCD_BACKLIGHT is not set
# CONFIG_HID_PICOLCD_LEDS is not set
-# CONFIG_HID_PICOLCD_CIR is not set
-# CONFIG_HID_PRIMAX is not set
+# CONFIG_HID_QUANTA is not set
CONFIG_HID_ROCCAT=y
-# CONFIG_HID_SAITEK is not set
+# CONFIG_HID_ROCCAT_ARVO is not set
+# CONFIG_HID_ROCCAT_KONE is not set
+# CONFIG_HID_ROCCAT_KONEPLUS is not set
+# CONFIG_HID_ROCCAT_KOVAPLUS is not set
+# CONFIG_HID_ROCCAT_PYRA is not set
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SONY=y
-# CONFIG_HID_SPEEDLINK is not set
CONFIG_HID_SUNPLUS=y
CONFIG_HID_GREENASIA=y
CONFIG_GREENASIA_FF=y
CONFIG_HID_SMARTJOYPLUS=y
CONFIG_SMARTJOYPLUS_FF=y
-# CONFIG_HID_TIVO is not set
CONFIG_HID_TOPSEED=y
CONFIG_HID_THRUSTMASTER=y
CONFIG_THRUSTMASTER_FF=y
CONFIG_HID_ZEROPLUS=y
CONFIG_ZEROPLUS_FF=y
CONFIG_HID_ZYDACRON=y
-# CONFIG_HID_SENSOR_HUB is not set
-
-#
-# USB HID support
-#
-CONFIG_USB_HID=y
-# CONFIG_HID_PID is not set
-# CONFIG_USB_HIDDEV is not set
-
-#
-# I2C HID support
-#
-# CONFIG_I2C_HID is not set
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
# CONFIG_USB_ARCH_HAS_OHCI is not set
@@ -2272,6 +2264,7 @@ CONFIG_USB_SERIAL_OPTION=y
# CONFIG_USB_SERIAL_ZIO is not set
# CONFIG_USB_SERIAL_SSU100 is not set
# CONFIG_USB_SERIAL_DEBUG is not set
+# CONFIG_USB_SERIAL_USI is not set
#
# USB Miscellaneous drivers
5 drivers/adc/core.c
View
@@ -145,16 +145,17 @@ static void adc_finished(struct adc_host *adc, int result)
}
void adc_core_irq_handle(struct adc_host *adc)
{
+ unsigned long flags;
int result = 0;
- spin_lock(&adc->lock);
+ spin_lock_irqsave(&adc->lock, flags);
result = adc->ops->read(adc);
adc_finished(adc, result);
if(!list_empty(&adc->req_head))
schedule_work(&adc->work);
- spin_unlock(&adc->lock);
+ spin_unlock_irqrestore(&adc->lock, flags);
}
int adc_host_read(struct adc_client *client, enum read_type type)
2  drivers/adc/plat/rk29_adc.c
View
@@ -123,7 +123,7 @@ static int rk29_adc_probe(struct platform_device *pdev)
goto err_alloc;
}
- ret = request_irq(dev->irq, rk29_adc_irq, 0, pdev->name, dev);
+ ret = request_threaded_irq(dev->irq, NULL, rk29_adc_irq, IRQF_ONESHOT, pdev->name, dev);
if (ret < 0) {
dev_err(&pdev->dev, "failed to attach adc irq\n");
goto err_alloc;
18 drivers/adc/plat/rk30_adc.c
View
@@ -45,6 +45,7 @@ static void rk30_adc_stop(struct adc_host *adc)
struct rk30_adc_device *dev = adc_priv(adc);
adc_writel(0, dev->regs + ADC_CTRL);
+ udelay(SAMPLE_RATE);
}
static int rk30_adc_read(struct adc_host *adc)
{
@@ -75,10 +76,7 @@ struct adc_test_data {
};
static void callback(struct adc_client *client, void *param, int result)
{
- if(result < 70)
- dev_info(client->adc->dev, "[chn%d] async_read = %d\n", client->chn, result);
- else
- dev_dbg(client->adc->dev, "[chn%d] async_read = %d\n", client->chn, result);
+ dev_dbg(client->adc->dev, "[chn%d] async_read = %d\n", client->chn, result);
return;
}
static void adc_timer(unsigned long data)
@@ -86,7 +84,7 @@ static void adc_timer(unsigned long data)
struct adc_test_data *test=(struct adc_test_data *)data;
queue_work(adc_wq, &test->timer_work);
- add_timer(&test->timer);
+ mod_timer(&test->timer, jiffies+msecs_to_jiffies(20));
}
static void adc_timer_work(struct work_struct *work)
{
@@ -95,10 +93,7 @@ static void adc_timer_work(struct work_struct *work)
timer_work);
adc_async_read(test->client);
sync_read = adc_sync_read(test->client);
- if(sync_read < 70)
- dev_info(test->client->adc->dev, "[chn%d] sync_read = %d\n", test->client->chn, sync_read);
- else
- dev_dbg(test->client->adc->dev, "[chn%d] sync_read = %d\n", test->client->chn, sync_read);
+ dev_dbg(test->client->adc->dev, "[chn%d] sync_read = %d\n", test->client->chn, sync_read);
}
static int rk30_adc_test(void)
@@ -112,8 +107,7 @@ static int rk30_adc_test(void)
test[i]->client = adc_register(i, callback, NULL);
INIT_WORK(&test[i]->timer_work, adc_timer_work);
setup_timer(&test[i]->timer, adc_timer, (unsigned long)test[i]);
- test[i]->timer.expires = jiffies + 1;
- add_timer(&test[i]->timer);
+ mod_timer(&test[i]->timer, jiffies+msecs_to_jiffies(20));
}
return 0;
@@ -141,7 +135,7 @@ static int rk30_adc_probe(struct platform_device *pdev)
goto err_alloc;
}
- ret = request_irq(dev->irq, rk30_adc_irq, 0, pdev->name, dev);
+ ret = request_threaded_irq(dev->irq, NULL, rk30_adc_irq, IRQF_ONESHOT, pdev->name, dev);
if (ret < 0) {
dev_err(&pdev->dev, "failed to attach adc irq\n");
goto err_alloc;
11 drivers/bluetooth/Kconfig
View
@@ -257,4 +257,15 @@ config BT_WILINK
Say Y here to compile support for Texas Instrument's WiLink7 driver
into the kernel or say M to compile it as module.
+
+if BCM4330
+choice
+ prompt "Select the bluetooth module"
+ default BT_MODULE_NH660
+
+ config BT_MODULE_NH660
+ bool "AzureWave NH660"
+endchoice
+endif
+
endmenu
23 drivers/gpio/gpiolib.c
View
@@ -1225,7 +1225,7 @@ int gpio_request(unsigned gpio, const char *label)
spin_unlock_irqrestore(&gpio_lock, flags);
return status;
}
-EXPORT_SYMBOL(gpio_request);//EXPORT_SYMBOL_GPL(gpio_request);
+EXPORT_SYMBOL_GPL(gpio_request);
void gpio_free(unsigned gpio)
{
@@ -1262,9 +1262,7 @@ void gpio_free(unsigned gpio)
spin_unlock_irqrestore(&gpio_lock, flags);
}
-//EXPORT_SYMBOL_GPL(gpio_free);
-EXPORT_SYMBOL(gpio_free);
-
+EXPORT_SYMBOL_GPL(gpio_free);
/**
* gpio_request_one - request a single GPIO with initial configuration
@@ -1420,9 +1418,7 @@ int gpio_direction_input(unsigned gpio)
__func__, gpio, status);
return status;
}
-//EXPORT_SYMBOL_GPL(gpio_direction_input);
-EXPORT_SYMBOL(gpio_direction_input);
-
+EXPORT_SYMBOL_GPL(gpio_direction_input);
int gpio_direction_output(unsigned gpio, int value)
{
@@ -1479,8 +1475,7 @@ int gpio_direction_output(unsigned gpio, int value)
__func__, gpio, status);
return status;
}
-//EXPORT_SYMBOL_GPL(gpio_direction_output);
-EXPORT_SYMBOL(gpio_direction_output);
+EXPORT_SYMBOL_GPL(gpio_direction_output);
/*
gpio pull up or pull down
@@ -1541,8 +1536,7 @@ int gpio_pull_updown(unsigned gpio, unsigned value)
__func__, gpio, status);
return status;
}
-//EXPORT_SYMBOL_GPL(gpio_pull_updown);
-EXPORT_SYMBOL(gpio_pull_updown);
+EXPORT_SYMBOL_GPL(gpio_pull_updown);
/**
* gpio_set_debounce - sets @debounce time for a @gpio
@@ -1632,9 +1626,7 @@ int __gpio_get_value(unsigned gpio)
trace_gpio_value(gpio, 1, value);
return value;
}
-//EXPORT_SYMBOL_GPL(__gpio_get_value);
-EXPORT_SYMBOL(__gpio_get_value);
-
+EXPORT_SYMBOL_GPL(__gpio_get_value);
/**
* __gpio_set_value() - assign a gpio's value
@@ -1658,8 +1650,7 @@ void __gpio_set_value(unsigned gpio, int value)
trace_gpio_value(gpio, 0, value);
chip->set(chip, gpio - chip->base, value);
}
-//EXPORT_SYMBOL_GPL(__gpio_set_value);
-EXPORT_SYMBOL(__gpio_set_value);
+EXPORT_SYMBOL_GPL(__gpio_set_value);
/**
* __gpio_cansleep() - report whether gpio value access will sleep
5 drivers/i2c/busses/Kconfig
View
@@ -907,6 +907,7 @@ if I2C_RK30
endif
config I2C4_RK30
bool "I2C4 Channel Support"
+ depends on !ARCH_RK2928
default y
help
This supports the use of the I2C4 channel on RK Soc.
@@ -1002,9 +1003,9 @@ if I2C_RK29
endif
endif
config I2C_DEV_RK29
- tristate "Rockchip I2C device interface support"
+ tristate "RK29 I2C device interface support"
default n
- depends on I2C_RK29 || I2C_RK30
+ depends on I2C_RK29
help
Nothing
endmenu
2  drivers/i2c/busses/i2c-rk30.c
View
@@ -127,7 +127,7 @@ static int rk30_i2c_probe(struct platform_device *pdev)
i2c_dbg(&pdev->dev, "clock source %p\n", i2c->clk);
-// clk_enable(i2c->clk);
+ clk_enable(i2c->clk);
/* map the registers */
6 drivers/input/touchscreen/Kconfig
View
@@ -136,6 +136,9 @@ config TOUCHSCREEN_GT8XX
help
goodix touch max y resolution
+config TOUCHSCREEN_CT36X
+ tristate "CT36X based touchscreens"
+
config RK28_I2C_TS_NTP070
tristate "NTP070 based touchscreens: NTP070 Interface"
depends on I2C_RK2818
@@ -977,6 +980,9 @@ config LAIBAO_TS
config TOUCHSCREEN_GT801_IIC
tristate "GT801_IIC based touchscreens"
depends on I2C2_RK29
+config TOUCHSCREEN_GT82X_IIC
+ tristate "GT82x_IIC based touchscreens"
+ depends on I2C2_RK30
config TOUCHSCREEN_GT818_IIC
tristate "GT818_IIC based touchscreens"
2  drivers/input/touchscreen/Makefile
View
@@ -83,6 +83,7 @@ obj-$(CONFIG_TOUCHSCREEN_FT5406) += ft5406_ts.o
obj-$(CONFIG_TOUCHSCREEN_FT5306) += ft5306_ts.o
obj-$(CONFIG_TOUCHSCREEN_FT5306_WPX2) += ft5306_ts_wpx2.o
obj-$(CONFIG_TOUCHSCREEN_GT819) += gt819.o
+obj-$(CONFIG_TOUCHSCREEN_CT36X) += ct36x_ts.o
obj-$(CONFIG_TOUCHSCREEN_NAS) += nas_ts.o
obj-$(CONFIG_LAIBAO_TS) += ft5x0x_i2c_ts.o
obj-$(CONFIG_TOUCHSCREEN_PIXCIR) += pixcir_i2c_ts.o
@@ -90,3 +91,4 @@ obj-$(CONFIG_TOUCHSCREEN_GT82X_IIC) += goodix_touch_82x.o
obj-$(CONFIG_TOUCHSCREEN_GT811_MALATA) += gt811_malata.o
obj-$(CONFIG_TOUCHSCREEN_GT8110_MALATA) += gt8110_malata.o
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_RMI4_I2C_RK) += rmi4/
+obj-$(CONFIG_TOUCHSCREEN_GT82X_IIC) += goodix_touch_82x.o
703 drivers/input/touchscreen/ct36x_ts.c
View
@@ -0,0 +1,703 @@
+/*
+ * drivers/input/touchscreen/gt801_ts.c
+ *
+ * Copyright (C) 2010 ROCKCHIP, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/earlysuspend.h>
+#include <linux/hrtimer.h>
+#include <linux/i2c.h>
+#include <linux/input.h>
+#include <linux/input/mt.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/gpio.h>
+#include <mach/iomux.h>
+#include <mach/board.h>
+#include <linux/platform_device.h>
+
+
+#define CT360_DEBUG 0
+#define MYCT360_DEBUG 0
+
+#if CT360_DEBUG
+ #define ct360printk(msg...) printk(msg);
+#else
+ #define ct360printk(msg...)
+#endif
+
+#if 0
+ #define yj_printk(msg...) printk(msg);
+#else
+ #define yj_printk(msg...)
+#endif
+
+#if 0
+ #define boot_printk(msg...) printk(msg);
+#else
+ #define boot_printk(msg...)
+#endif
+
+#if MYCT360_DEBUG
+ #define myct360printk(msg...) printk(msg);
+#else
+ #define myct360printk(msg...)
+#endif
+
+#define IOMUX_NAME_SIZE 48
+
+enum regadd {
+ ptxh = 0, ptxl = 1, ptyh = 2, ptyl = 3, ptpressure = 4,
+};
+enum touchstate {
+ TOUCH_UP = 0, TOUCH_DOWN = 1,
+};
+
+
+#define TOUCH_NUMBER 10
+#define TOUCH_REG_NUM 6
+
+#define ct360_TS_NAME "ct3610_ts"
+
+struct ct360_ts_data {
+ u16 x_max;
+ u16 y_max;
+ bool swap_xy; //define?
+ int irq;
+ struct i2c_client *client;
+ struct input_dev *input_dev;
+ struct workqueue_struct *ct360_wq;
+ struct work_struct work;
+ struct early_suspend early_suspend;
+};
+/*tochscreen private data*/
+static int touch_state[TOUCH_NUMBER] = {TOUCH_UP,TOUCH_UP};
+
+#ifdef CONFIG_HAS_EARLYSUSPEND
+static void ct360_ts_early_suspend(struct early_suspend *h);
+static void ct360_ts_late_resume(struct early_suspend *h);
+#endif
+
+/*read the ct360 register ,used i2c bus*/
+static int ct360_read_regs(struct i2c_client *client, u8 buf[], unsigned len)
+{
+ int ret;
+ ret =i2c_master_normal_recv(client, buf, len, 400*1000);
+ if(ret < 0)
+ printk("ct360_ts_work_func:i2c_transfer fail =%d\n",ret);
+ return ret;
+}
+/* set the ct360 registe,used i2c bus*/
+static int ct360_write_regs(struct i2c_client *client, u8 reg, u8 const buf[], unsigned short len)
+{
+ int ret;
+ ret = i2c_master_reg8_send(client,reg, buf, len, 100*1000);
+ if (ret < 0) {
+ printk("ct360_ts_work_func:i2c_transfer fail =%d\n",ret);
+ }
+ return ret;
+}
+
+char const Binary_Data[32768]=
+{
+//#include "CT365RC972030D_V39120329A_waterproof.dat"
+#include "ts36100.dat"
+};
+
+char CTP_BootLoader(struct ct360_ts_data *ts)
+{
+ unsigned int i = 0 ;
+ unsigned int j = 0 ;
+ unsigned int version = 0;
+ char value = 0;
+ char I2C_Buf[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+ unsigned int Flash_Address = 0 ;
+ char CheckSum[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // 128/8 = 16 times
+
+ //--------------------------------------
+ // Step1 --> initial BootLoader
+ // Note. 0x7F -> 0x00 -> 0xA5 ;
+ //--------------------------------------
+ I2C_Buf [0] = 0x00;
+ I2C_Buf [1] = 0xA5;
+
+ ts->client->addr = 0x7F;
+ ct360_write_regs(ts->client,0x00,&I2C_Buf[1], 1); // Host issue 0xA5 Command to CT365
+ mdelay(3); // Delay 1 ms
+
+
+ //------------------------------
+ // Reset I2C Offset address
+ // Note. 0x7F -> 0x00
+ //------------------------------
+ I2C_Buf [0] = 0x00 ;
+ i2c_master_normal_send(ts->client,I2C_Buf, 1,100*1000); // Reset CT365 I2C Offset address
+ udelay(500); // Delay 500 us
+
+ //------------------------------
+ // Read I2C Bus status
+ //------------------------------
+ i2c_master_normal_recv(ts->client,&value, 1,100*1000);
+
+ boot_printk("%s......0...\n",__FUNCTION__);
+ // if return "AAH" then going next step
+ if (value != 0xAA)
+ return 0;
+
+ boot_printk("%s......1...\n",__FUNCTION__);
+
+ {
+ I2C_Buf[0] = 0x00;
+ I2C_Buf[1] = 0x99; // Generate check sum command
+ I2C_Buf[2] = (char)(0x0044 >> 8); // define a flash address for CT365 to generate check sum
+ I2C_Buf[3] = (char)(0x0044 & 0xFF); //
+ I2C_Buf[4] = 0x08; // Define a data length for CT365 to generate check sum
+
+ i2c_master_normal_send(ts->client,I2C_Buf, 5,100*1000); // Write Genertate check sum command to CT365
+
+ mdelay(1); // Delay 1 ms
+
+ i2c_master_reg8_recv(ts->client,0x00, I2C_Buf,13, 100*1000); // Read check sum and flash data from CT365
+ if (!(I2C_Buf[5] != 'V') || (I2C_Buf[9] != 'T'))
+ version = 1;
+ }
+
+ {
+ I2C_Buf[0] = 0x00;
+ I2C_Buf[1] = 0x99; // Generate check sum command
+ I2C_Buf[2] = (char)(0x00a4 >> 8); // define a flash address for CT365 to generate check sum
+ I2C_Buf[3] = (char)(0x00a4 & 0xFF); //
+ I2C_Buf[4] = 0x08; // Define a data length for CT365 to generate check sum
+
+ i2c_master_normal_send(ts->client,I2C_Buf, 5,100*1000); // Write Genertate check sum command to CT365
+
+ mdelay(1); // Delay 1 ms
+
+ i2c_master_reg8_recv(ts->client,0x00, I2C_Buf,13, 100*1000); // Read check sum and flash data from CT365
+ if (!(I2C_Buf[5] != 'V') || (I2C_Buf[9] != 'T'))
+ version = 2;
+ }
+
+ if (!version)
+ return 0;
+
+ //------------------------------
+ // Reset I2C Offset address
+ // Note. 0x7F -> 0x00
+ //------------------------------
+ I2C_Buf [0] = 0x00;
+ I2C_Buf [1] = 0xA5;
+
+ i2c_master_normal_send(ts->client,I2C_Buf, 2,100*1000); // Host issue 0xA5 Command to CT365
+ mdelay(3);
+
+ I2C_Buf [0] = 0x00 ;
+ i2c_master_normal_send(ts->client,I2C_Buf, 1,100*1000); // Reset CT365 I2C Offset address
+ udelay(500);
+ //-----------------------------------------------------
+ // Step 2 : Erase 32K flash memory via Mass Erase (33H)
+ // 0x7F --> 0x00 --> 0x33 --> 0x00 ;
+ //-----------------------------------------------------
+ I2C_Buf [0] = 0x00; // Offset address
+ I2C_Buf [1] = 0x33; // Mass Erase command
+ I2C_Buf [2] = 0x00;
+
+ i2c_master_normal_send(ts->client,I2C_Buf,3,100*1000);
+ mdelay(10); // Delay 10 mS
+
+
+ //------------------------------
+ // Reset I2C Offset address
+ // Note. 0x7F -> 0x00
+ //------------------------------
+ I2C_Buf [0] = 0x00 ;
+ i2c_master_normal_send(ts->client,I2C_Buf, 1,100*1000); // Reset CT365 I2C Offset address
+ udelay(500); // Delay 500 us
+
+
+ //------------------------------
+ // Read I2C Bus status
+ //------------------------------
+ i2c_master_normal_recv(ts->client,&value, 1,100*1000);
+
+ // if return "AAH" then going next step
+ if (value != 0xAA)
+ return 0;
+
+ boot_printk("%s......2...\n",__FUNCTION__);
+
+ //----------------------------------------
+ // Step3. Host write 128 bytes to CT365
+ // Step4. Host read checksum to verify ;
+ // Write/Read for 256 times ( 32k Bytes )
+ //----------------------------------------
+
+ for ( j = 0 ; j < 256 ; j++ ) // 32k/128 = 256 times
+ {
+ Flash_Address = 128*j ; // 0 ~ 127 ; 128 ~ 255 ;
+
+ for ( i = 0 ; i < 16 ; i++ ) // 128/8 = 16 times for One Row program
+ {
+ // Step 3 : write binary data to CT365
+ I2C_Buf[0] = 0x00; // Offset address
+ I2C_Buf[1] = 0x55; // Flash write command
+ I2C_Buf[2] = (char)(Flash_Address >> 8); // Flash address [15:8]
+ I2C_Buf[3] = (char)(Flash_Address & 0xFF); // Flash address [7:0]
+ I2C_Buf[4] = 0x08; // Data Length
+ I2C_Buf[6] = Binary_Data[Flash_Address + 0]; // Binary data 1
+ I2C_Buf[7] = Binary_Data[Flash_Address + 1]; // Binary data 2
+ I2C_Buf[8] = Binary_Data[Flash_Address + 2]; // Binary data 3
+ I2C_Buf[9] = Binary_Data[Flash_Address + 3]; // Binary data 4
+ I2C_Buf[10] = Binary_Data[Flash_Address + 4]; // Binary data 5
+ I2C_Buf[11] = Binary_Data[Flash_Address + 5]; // Binary data 6
+ I2C_Buf[12] = Binary_Data[Flash_Address + 6]; // Binary data 7
+ I2C_Buf[13] = Binary_Data[Flash_Address + 7]; // Binary data 8
+
+ // Calculate a check sum by Host controller.
+ // Checksum = / (FLASH_ADRH+FLASH_ADRL+LENGTH+
+ // Binary_Data1+Binary_Data2+Binary_Data3+Binary_Data4+
+ // Binary_Data5+Binary_Data6+Binary_Data7+Binary_Data8) + 1
+ CheckSum[i] = ~(I2C_Buf[2] + I2C_Buf[3] + I2C_Buf[4] + I2C_Buf[6] + I2C_Buf[7] +
+ I2C_Buf[8] + I2C_Buf[9] + I2C_Buf[10] + I2C_Buf[11] + I2C_Buf[12] +
+ I2C_Buf[13]) + 1;
+
+ I2C_Buf[5] = CheckSum[i]; // Load check sum to I2C Buffer
+
+ i2c_master_normal_send(ts->client,I2C_Buf, 14,100*1000); // Host write I2C_Buf[012] to CT365.
+
+ mdelay(1); // 8 Bytes program --> Need 1 ms delay time
+
+ Flash_Address += 8 ; // Increase Flash Address. 8 bytes for 1 time
+
+ }
+
+ mdelay(20); // Each Row command --> Need 20 ms delay time
+
+ Flash_Address = 128*j ; // 0 ~ 127 ; 128 ~ 255 ;
+
+ // Step4. Verify process
+ for ( i = 0 ; i < 16 ; i++ ) // 128/8 = 16 times for One Row program
+ {
+ //Step 4 : Force CT365 generate check sum for host to compare data.
+ //Prepare get check sum from CT365
+ I2C_Buf[0] = 0x00;
+ I2C_Buf[1] = 0x99; // Generate check sum command
+ I2C_Buf[2] = (char)(Flash_Address >> 8); // define a flash address for NT1100x to generate check sum
+ I2C_Buf[3] = (char)(Flash_Address & 0xFF); //
+ I2C_Buf[4] = 0x08; // Define a data length for CT36x to generate check sum
+
+ i2c_master_normal_send(ts->client,I2C_Buf, 5,100*1000); // Write Genertate check sum command to CT365
+
+ mdelay(1); // Delay 1 ms
+
+ i2c_master_reg8_recv(ts->client,0x00,I2C_Buf, 13,100*1000); // Read check sum and flash data from CT365
+
+ // Compare host check sum with CT365 check sum(I2C_Buf[4])
+ if ( I2C_Buf[4] != CheckSum[i] )
+ {
+ boot_printk("%s......3...\n",__FUNCTION__);
+ return 0;
+ }
+
+ Flash_Address += 8; // Increase Flash Address.
+
+ }
+
+ }
+
+ ts->client->addr = 0x01;
+ boot_printk("%s......4...\n",__FUNCTION__);
+ return 1 ;
+
+}
+
+static void ct360_ts_work_func(struct work_struct *work)
+{
+
+ unsigned short x;
+ unsigned short y;
+ int i,ret,syn_flag=0;
+ char toatl_num = 0;
+ unsigned char buf[TOUCH_REG_NUM*TOUCH_NUMBER+1] = {0};
+ int point_status;
+ int point_num,point_pressure;
+
+ struct ct360_ts_data *ts = container_of(work,struct ct360_ts_data,work);
+
+ ret= ct360_read_regs(ts->client,buf,60);//only one data represent the current touch num
+ if (ret < 0) {
+ printk("%s:i2c_transfer fail =%d\n",__FUNCTION__,toatl_num);
+ goto out;
+ return;
+ }
+
+ for (i=0; i<60; i+=TOUCH_REG_NUM)
+ {
+ if (((buf[i+1] << 4)|(buf[i+3] >> 4)) != 0x0fff)
+ {
+ x = ((buf[i+1] << 4)|(buf[i+3] >> 4));
+ y = ((buf[i+2] << 4)|(buf[i+3]&0x0F));
+ point_status=buf[i]&0x07;
+ point_num = buf[i]>>3;
+ point_pressure = (buf[i+5]*4)>=255? 255 : (buf[i+5]*4);
+
+ if((point_status == 1) || (point_status == 2)){
+ input_mt_slot(ts->input_dev, point_num-1);
+ input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, point_num-1);
+ input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x);
+ input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y);
+ input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, point_pressure); //Finger Size
+ input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, point_pressure); //Touch Size
+ //input_mt_sync(ts->input_dev);
+ syn_flag = 1;
+ touch_state[point_num-1] = TOUCH_DOWN;
+ }
+ else if(point_status == 3){
+ input_mt_slot(ts->input_dev, point_num-1);
+ input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, -1);
+ touch_state[point_num-1] = TOUCH_UP;
+ syn_flag =1;
+ }
+ }
+ }
+
+ if(syn_flag){
+ input_sync(ts->input_dev);
+ }
+
+out:
+ enable_irq(ts->irq);
+ return;
+}
+
+static irqreturn_t ct360_ts_irq_handler(int irq, void *dev_id)
+{
+ struct ct360_ts_data *ts = dev_id;
+
+ disable_irq_nosync(ts->irq);
+ queue_work(ts->ct360_wq, &ts->work);
+
+ return IRQ_HANDLED;
+}
+
+static int ct360_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
+{
+ struct ct360_ts_data *ts;
+ struct ct360_platform_data *pdata = client->dev.platform_data;
+ int ret = 0;
+ char loader_buf[2] = {0x3f,0xff};
+ char boot_buf = 0;
+ char boot_loader[2] = {0};
+ printk("%s \n",__FUNCTION__);
+
+ if (!pdata) {
+ dev_err(&client->dev, "empty platform_data\n");
+ goto err_check_functionality_failed;
+ }
+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
+ printk(KERN_ERR "ct360_ts_probe: need I2C_FUNC_I2C\n");
+ ret = -ENODEV;
+ goto err_check_functionality_failed;
+ }
+
+ ts = kzalloc(sizeof(*ts), GFP_KERNEL);
+ if (ts == NULL) {
+ ret = -ENOMEM;
+ goto err_alloc_data_failed;
+ }
+
+ ts->ct360_wq = create_singlethread_workqueue("ct360_wq");
+ if (!ts->ct360_wq){
+ printk(KERN_ERR"%s: create workqueue failed\n", __func__);
+ ret = -ENOMEM;
+ goto err_input_dev_alloc_failed;
+ }
+
+ INIT_WORK(&ts->work, ct360_ts_work_func);
+
+ ts->client = client;
+ i2c_set_clientdata(client, ts);
+
+ if(pdata->hw_init)
+ pdata->hw_init();
+/*
+ if(pdata->shutdown){
+ pdata->shutdown(1);
+ mdelay(200);
+ pdata->shutdown(0);
+ mdelay(50);
+ pdata->shutdown(1);
+ mdelay(50);
+ }
+ */
+ gpio_request(RK30_PIN4_PC2, "ct360_init_gpio");
+ gpio_direction_output(RK30_PIN4_PC2, GPIO_LOW);
+ gpio_set_value(RK30_PIN4_PC2, GPIO_LOW);
+ mdelay(80);
+ gpio_set_value(RK30_PIN4_PC2, GPIO_HIGH);
+ mdelay(10);
+ gpio_direction_input(RK30_PIN4_PC2);
+ //加40ms延时,否则读取出错。。
+ mdelay(40);
+ ret=ct360_write_regs(client,0xfF, loader_buf, 2);
+ if(ret<0){
+ printk("\n--%s--Set Register values error !!!\n",__FUNCTION__);
+ }
+
+ mdelay(1);
+ printk("%s...........%d\n",__FUNCTION__,boot_buf);
+ ret = i2c_master_normal_send(client,boot_loader,1,100*1000);
+ if(ret < 0)
+ printk("ct360_ts_probe:sdf i2c_transfer fail =%d\n",ret);
+ else
+ printk("%s.............ok\n",__FUNCTION__);
+
+ mdelay(2);
+ ret = ct360_read_regs(client,&boot_buf,1);
+ printk("%s....3......%x\n",__FUNCTION__,boot_buf);
+
+ if(ret < 0)
+ printk("ct360_ts_probe:i2c_transfer fail =%d\n",ret);
+ else
+ printk("%s.............boot_buf=%d\n",__FUNCTION__,boot_buf);
+
+ if (Binary_Data[32756] != boot_buf)
+ {
+ printk("start Bootloader ...........boot_Buf=%x.....%d......%x..........TP \n\n",boot_buf,(Binary_Data[16372]-boot_buf),Binary_Data[16372]);
+ ret = CTP_BootLoader(ts);
+ if (ret == 1)
+ printk("TP Bootloader success\n");
+ else
+ printk("TP Bootloader failed ret=%d\n",ret);
+ printk("stop Bootloader.................................TP \n\n");
+ }
+ else
+ {
+ printk("Don't need bootloader.skip it %x \n",Binary_Data[16372]);
+ }
+
+ if(pdata->shutdown){
+ pdata->shutdown(1);
+ mdelay(5);
+ pdata->shutdown(0);
+ mdelay(20);
+ pdata->shutdown(1);
+ mdelay(20);
+ }
+ ts->client->addr = 0x01;
+
+ /* allocate input device */
+ ts->input_dev = input_allocate_device();
+ if (ts->input_dev == NULL) {
+ ret = -ENOMEM;
+ printk(KERN_ERR "%s: Failed to allocate input device\n",__FUNCTION__);
+ goto err_input_dev_alloc_failed;
+ }
+
+ ts->x_max = pdata->x_max;
+ ts->y_max = pdata->y_max;
+ ts->swap_xy = 1;
+ ts->input_dev->name = ct360_TS_NAME;
+ ts->input_dev->dev.parent = &client->dev;
+
+ //set_bit(EV_SYN, ts->input_dev->evbit);
+ //set_bit(BTN_TOUCH, ts->input_dev->keybit);
+ set_bit(EV_ABS, ts->input_dev->evbit);
+ set_bit(INPUT_PROP_DIRECT, ts->input_dev->propbit);
+ //set_bit(BTN_2, ts->input_dev->keybit);
+
+ input_mt_init_slots(ts->input_dev, TOUCH_NUMBER);
+ input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, 0, ts->x_max, 0, 0);
+ input_set_abs_params(ts->input_dev, ABS_MT_POSITION_Y, 0, ts->y_max, 0, 0);
+ input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); //Finger Size
+ input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0); //Touch Size
+ input_set_abs_params(ts->input_dev, ABS_MT_TRACKING_ID, 0, 10, 0, 0); //Touch Size
+
+ ret = input_register_device(ts->input_dev);
+ if (ret) {
+ printk(KERN_ERR "%s: Unable to register %s input device\n", __FUNCTION__,ts->input_dev->name);
+ goto err_input_register_device_failed;
+ }
+
+ ts->irq = gpio_to_irq(client->irq);
+ ret = request_irq(ts->irq, ct360_ts_irq_handler, IRQF_TRIGGER_FALLING, client->name, ts);
+ if (ret){
+ printk("!!! ct360 request_irq failed\n");
+ goto err_input_register_device_failed;
+ }
+
+#ifdef CONFIG_HAS_EARLYSUSPEND
+ ts->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1;
+ ts->early_suspend.suspend = ct360_ts_early_suspend;
+ ts->early_suspend.resume = ct360_ts_late_resume;
+ register_early_suspend(&ts->early_suspend);
+#endif
+
+ printk("%s: probe ok!!\n", __FUNCTION__);
+
+ return 0;
+
+err_input_register_device_failed:
+ input_free_device(ts->input_dev);
+err_input_dev_alloc_failed:
+ kfree(ts);
+err_alloc_data_failed:
+err_check_functionality_failed:
+
+ return ret;
+}
+
+static int ct360_ts_remove(struct i2c_client *client)
+{
+ struct ct360_ts_data *ts = i2c_get_clientdata(client);
+ unregister_early_suspend(&ts->early_suspend);
+ free_irq(ts->irq, ts);
+ input_unregister_device(ts->input_dev);
+ if (ts->ct360_wq)
+ destroy_workqueue(ts->ct360_wq);
+
+ kfree(ts);
+ return 0;
+}
+
+static int ct360_ts_suspend(struct i2c_client *client, pm_message_t mesg)
+{
+ struct ct360_ts_data *ts = i2c_get_clientdata(client);
+
+ int ret,i;
+ char buf[3] = {0xff,0x8f,0xff};
+
+ //disable_irq(ts->irq);
+ free_irq(ts->irq,ts);
+ cancel_work_sync(&ts->work);
+ flush_work(&ts->work);
+
+ ret = i2c_master_normal_send(client, buf, 3, 400*1000);
+ if (ret < 0) {
+ printk("ct360_ts_suspend:i2c_transfer fail 1=%d\n",ret);
+ }
+ msleep(3);
+ buf[0] = 0x00;
+ buf[1] = 0xaf;
+ ret = i2c_master_normal_send(client, buf, 2, 400*1000);
+ if (ret < 0) {
+ printk("ct360_ts_suspend:i2c_transfer fail 2=%d\n",ret);
+ }
+
+ for (i =0; i<10; i++)
+ {
+ if (touch_state[i] == TOUCH_DOWN)
+ {
+ input_mt_slot(ts->input_dev, i);
+ input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, -1);
+ touch_state[i] = TOUCH_UP;
+ }
+ }
+ return ret;
+}
+
+static int ct360_ts_resume(struct i2c_client *client)
+{
+ char buf[2] = {0x00,0x5A};
+ struct ct360_ts_data *ts = i2c_get_clientdata(client);
+ struct ct360_platform_data *pdata = client->dev.platform_data;
+ int ret = 0;
+
+
+ gpio_request(RK30_PIN4_PC2, "ct360_init_gpio");
+ gpio_direction_output(RK30_PIN4_PC2, GPIO_LOW);
+ gpio_set_value(RK30_PIN4_PC2, GPIO_LOW);
+ mdelay(80);
+ gpio_set_value(RK30_PIN4_PC2, GPIO_HIGH);
+ mdelay(10);
+ gpio_direction_input(RK30_PIN4_PC2);
+ buf[0] = 0x00;
+ buf[1] = 0x5A;
+ ts->client->addr = 0x7F;
+ i2c_master_normal_send(ts->client,buf, 2,100*1000);
+
+ mdelay(10);
+ ts->client->addr = 0x01;
+
+ if(pdata->shutdown)
+ { pdata->shutdown(1);
+ mdelay(200);
+ pdata->shutdown(0);
+ mdelay(50);
+ pdata->shutdown(1);
+ mdelay(50);
+ }
+ printk("ct360 TS Resume\n");
+
+
+ ret = request_irq(ts->irq, ct360_ts_irq_handler, IRQF_TRIGGER_FALLING, client->name, ts);
+ if (ret){
+ printk("!!! ct360 request_irq failed\n");
+ }
+ return ret;
+}
+
+#ifdef CONFIG_HAS_EARLYSUSPEND
+static void ct360_ts_early_suspend(struct early_suspend *h)
+{
+ struct ct360_ts_data *ts;
+ ts = container_of(h, struct ct360_ts_data, early_suspend);
+ ct360_ts_suspend(ts->client, PMSG_SUSPEND);
+}
+
+static void ct360_ts_late_resume(struct early_suspend *h)
+{
+ struct ct360_ts_data *ts;
+ ts = container_of(h, struct ct360_ts_data, early_suspend);
+ ct360_ts_resume(ts->client);
+}
+#endif
+
+static const struct i2c_device_id ct360_ts_id[] = {
+ { ct360_TS_NAME, 0 },
+ { }
+};
+
+static struct i2c_driver ct360_ts_driver = {
+ .probe = ct360_ts_probe,
+ .remove = ct360_ts_remove,
+#ifndef CONFIG_HAS_EARLYSUSPEND
+ .suspend = ct360_ts_suspend,
+ .resume = ct360_ts_resume,
+#endif
+ .id_table = ct360_ts_id,
+ .driver = {
+ .name = ct360_TS_NAME,
+ },
+};
+
+static int __devinit ct360_ts_init(void)
+{
+ printk("%s\n",__FUNCTION__);
+
+ return i2c_add_driver(&ct360_ts_driver);
+}
+
+static void __exit ct360_ts_exit(void)
+{
+ printk("%s\n",__FUNCTION__);
+ i2c_del_driver(&ct360_ts_driver);
+}
+
+module_init(ct360_ts_init);
+module_exit(ct360_ts_exit);
+
+MODULE_DESCRIPTION("ct360 Touchscreen Driver");
+MODULE_LICENSE("GPL");
2,048 drivers/input/touchscreen/ts36100.dat
View
2,048 additions, 0 deletions not shown
42 drivers/media/video/Kconfig
View
@@ -1194,7 +1194,13 @@ config SIV120B_USER_DEFINED_SERIES
depends on SOC_CAMERA_SIV120B
bool "SIV120B user defined init series"
default n
-
+
+config SOC_CAMERA_SIV121D
+ tristate "siv121d support for rockchip"
+ depends on SOC_CAMERA && I2C
+ help
+ This is a SIV121D camera driver for rockchip
+
config SOC_CAMERA_SID130B
tristate "sid130b support for rockchip"
depends on SOC_CAMERA && I2C
@@ -1217,6 +1223,40 @@ config NT99250_USER_DEFINED_SERIES
bool "NT99250 user defined init series"
default n
+config SOC_CAMERA_GC0329
+ tristate "gc0329 camera support for rockchip"
+ depends on SOC_CAMERA && I2C
+ help
+ This is a gc0329 camera driver for rockchip
+
+config GC0329_USER_DEFINED_SERIES
+ depends on SOC_CAMERA_GC0329
+ bool "GC0329 user defined init series"
+ default n
+
+config SOC_CAMERA_S5K5CA
+ tristate "s5k5ca camera support for rockchip"
+ depends on SOC_CAMERA && I2C
+ help
+ This is a s5k5ca camera driver for rockchip
+
+config S5K5CA_USER_DEFINED_SERIES
+ depends on SOC_CAMERA_S5K5CA
+ bool "s5k5ca user defined init series"
+ default n
+
+config SOC_CAMERA_SP0838
+ tristate "sp0838 camera support for rockchip"
+ depends on SOC_CAMERA && I2C
+ help
+ This is a sp0838 camera driver for rockchip
+
+config S5K5CA_USER_DEFINED_SERIES
+ depends on SOC_CAMERA_SP0838
+ bool "sp0838 user defined init series"
+ default n
+
+
config SOC_CAMERA_OV9640
tristate "ov9640 camera support"
depends on SOC_CAMERA && I2C
4 drivers/media/video/Makefile
View
@@ -108,10 +108,14 @@ obj-$(CONFIG_SOC_CAMERA_GC0309) += gc0309.o
obj-$(CONFIG_SOC_CAMERA_GC0309_FOR_TD8801) += gc0309_for_td8801.o
obj-$(CONFIG_SOC_CAMERA_GC2015) += gc2015.o
obj-$(CONFIG_SOC_CAMERA_SIV120B) += siv120b.o
+obj-$(CONFIG_SOC_CAMERA_SIV121D) += siv121d.o
obj-$(CONFIG_SOC_CAMERA_SID130B) += sid130B.o
obj-$(CONFIG_SOC_CAMERA_HI253) += hi253.o
obj-$(CONFIG_SOC_CAMERA_HI704) += hi704.o
obj-$(CONFIG_SOC_CAMERA_NT99250) += nt99250.o
+obj-$(CONFIG_SOC_CAMERA_GC0329) += gc0329.o
+obj-$(CONFIG_SOC_CAMERA_SP0838) += sp0838.o
+obj-$(CONFIG_SOC_CAMERA_S5K5CA) += s5k5ca.o
# And now the v4l2 drivers:
obj-$(CONFIG_VIDEO_BT848) += bt8xx/
3,046 drivers/media/video/gc0329.c
View
@@ -0,0 +1,3046 @@
+
+/*
+o* Driver for MT9M001 CMOS Image Sensor from Micron
+ *
+ * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/videodev2.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+#include <linux/log2.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/circ_buf.h>
+#include <linux/miscdevice.h>
+#include <media/v4l2-common.h>
+#include <media/v4l2-chip-ident.h>
+#include <media/soc_camera.h>
+#include <plat/rk_camera.h>
+
+static int debug;
+module_param(debug, int, S_IRUGO|S_IWUSR);
+
+#define dprintk(level, fmt, arg...) do { \
+ if (debug >= level) \
+ printk(KERN_WARNING fmt , ## arg); } while (0)
+
+#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__)
+#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__)
+
+
+#define _CONS(a,b) a##b
+#define CONS(a,b) _CONS(a,b)
+
+#define __STR(x) #x
+#define _STR(x) __STR(x)
+#define STR(x) _STR(x)
+
+#define MIN(x,y) ((x<y) ? x: y)
+#define MAX(x,y) ((x>y) ? x: y)
+
+/* Sensor Driver Configuration */
+#define SENSOR_NAME RK29_CAM_SENSOR_GC0329
+#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0329
+#define SENSOR_ID 0xc0 //GC0329 ID
+#define SENSOR_MIN_WIDTH 640//176
+#define SENSOR_MIN_HEIGHT 480//144
+#define SENSOR_MAX_WIDTH 640
+#define SENSOR_MAX_HEIGHT 480
+#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */
+#define SENSOR_INIT_HEIGHT 480
+#define SENSOR_INIT_WINSEQADR sensor_vga
+#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8
+
+#define CONFIG_SENSOR_WhiteBalance 1
+#define CONFIG_SENSOR_Brightness 0
+#define CONFIG_SENSOR_Contrast 0
+#define CONFIG_SENSOR_Saturation 0
+#define CONFIG_SENSOR_Effect 1
+#define CONFIG_SENSOR_Scene 1
+#define CONFIG_SENSOR_AntiBanding 0
+#define CONFIG_SENSOR_DigitalZoom 0
+#define CONFIG_SENSOR_Focus 0
+#define CONFIG_SENSOR_Exposure 0
+#define CONFIG_SENSOR_Flash 0
+#define CONFIG_SENSOR_Mirror 0
+#define CONFIG_SENSOR_Flip 0
+
+#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */
+/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */
+#define CONFIG_SENSOR_I2C_NOSCHED 0
+#define CONFIG_SENSOR_I2C_RDWRCHK 0
+
+#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\
+ SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH|\
+ SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ)
+
+#define COLOR_TEMPERATURE_CLOUDY_DN 6500
+#define COLOR_TEMPERATURE_CLOUDY_UP 8000
+#define COLOR_TEMPERATURE_CLEARDAY_DN 5000
+#define COLOR_TEMPERATURE_CLEARDAY_UP 6500
+#define COLOR_TEMPERATURE_OFFICE_DN 3500
+#define COLOR_TEMPERATURE_OFFICE_UP 5000
+#define COLOR_TEMPERATURE_HOME_DN 2500
+#define COLOR_TEMPERATURE_HOME_UP 3500
+
+#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a))
+#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a)
+
+#define SENSOR_AF_IS_ERR (0x00<<0)
+#define SENSOR_AF_IS_OK (0x01<<0)
+#define SENSOR_INIT_IS_ERR (0x00<<28)
+#define SENSOR_INIT_IS_OK (0x01<<28)
+struct reginfo
+{
+ u8 reg;
+ u8 val;
+};
+
+/* init 640X480 VGA */
+static struct reginfo sensor_init_data[] =
+{
+ // TODO: add initial code here
+ {0xfe, 0x80},
+ {0xfe, 0x80},
+ {0xfc, 0x16},
+ {0xfc, 0x16},
+ {0xfc, 0x16},
+ {0xfc, 0x16},
+ {0xfe, 0x00},
+ {0xf0, 0x07},
+ {0xf1, 0x01},
+
+
+
+
+ {0x73, 0x90},
+ {0x74, 0x80},
+ {0x75, 0x80},
+ {0x76, 0x94},
+
+ {0x42, 0x00},
+ {0x77, 0x57},
+ {0x78, 0x4d},
+ {0x79, 0x45},
+ //{0x42, 0xfc},
+
+ ////////////////////analog////////////////////
+ {0x0a, 0x02},
+ {0x0c, 0x02},
+ {0x17, 0x17},
+ {0x19, 0x05},
+ {0x1b, 0x24},
+ {0x1c, 0x04},
+ {0x1e, 0x08},
+ {0x1f, 0xc0}, //Analog_mode2//[7:6] comv_r
+ {0x20, 0x00},
+ {0x21, 0x48},
+ {0x22, 0xba},
+ {0x23, 0x22},
+ {0x24, 0x17},
+
+ ////////////////////blk////////////////////
+ {0x26, 0xf7},
+ {0x29, 0x80},
+ {0x32, 0x04},
+ {0x33, 0x20},
+ {0x34, 0x20},
+ {0x35, 0x20},
+ {0x36, 0x20},
+
+ ////////////////////ISP BLOCK ENABL////////////////////
+ {0x40, 0xff},
+ {0x41, 0x44},
+ {0x42, 0x7e},
+ {0x44, 0xa2},
+ {0x46, 0x03},
+ {0x4b, 0xca},
+ {0x4d, 0x01},
+ {0x4f, 0x01},
+ {0x70, 0x48},
+
+ //{0xb0, 0x00},
+ //{0xbc, 0x00},
+ //{0xbd, 0x00},
+ //{0xbe, 0x00},
+ ////////////////////DNDD////////////////////
+ {0x80, 0xe7},
+ {0x82, 0x55},
+ {0x83, 0x03},
+ {0x87, 0x4a},
+
+ ////////////////////INTPEE////////////////////
+ {0x95, 0x45},
+
+ ////////////////////ASDE////////////////////
+ //{0xfe, 0x01},
+ //{0x18, 0x22},
+ //{0xfe, 0x00);
+ //{0x9c, 0x0a},
+ //{0xa0, 0xaf},
+ //{0xa2, 0xff},
+ //{0xa4, 0x50},
+ //{0xa5, 0x21},
+ //{0xa7, 0x35},
+
+ ////////////////////RGB gamma////////////////////
+ //RGB gamma m4'
+ {0xbf, 0x06},
+ {0xc0, 0x14},
+ {0xc1, 0x27},
+ {0xc2, 0x3b},
+ {0xc3, 0x4f},
+ {0xc4, 0x62},
+ {0xc5, 0x72},
+ {0xc6, 0x8d},
+ {0xc7, 0xa4},
+ {0xc8, 0xb8},
+ {0xc9, 0xc9},
+ {0xcA, 0xd6},
+ {0xcB, 0xe0},
+ {0xcC, 0xe8},
+ {0xcD, 0xf4},
+ {0xcE, 0xFc},
+ {0xcF, 0xFF},
+
+ //////////////////CC///////////////////
+ {0xfe, 0x00},
+
+ {0xb3, 0x44},
+ {0xb4, 0xfd},
+ {0xb5, 0x02},
+ {0xb6, 0xfa},
+ {0xb7, 0x48},
+ {0xb8, 0xf0},
+
+ // crop
+ {0x50, 0x01},
+
+ ////////////////////YCP////////////////////
+ {0xfe, 0x00},
+ {0xd1, 0x38},
+ {0xd2, 0x38},
+ {0xdd, 0x54},
+
+ ////////////////////AEC////////////////////
+ {0xfe, 0x01},
+ {0x10, 0x40},
+ {0x11, 0x21},//a1
+ {0x12, 0x07},
+ {0x13, 0x50}, //Y target
+ {0x17, 0x88},
+ {0x21, 0xb0},
+ {0x22, 0x48},
+ {0x3c, 0x95},
+ {0x3d, 0x50},
+ {0x3e, 0x48},
+
+ ////////////////////AWB////////////////////
+ {0xfe, 0x01},
+ {0x06, 0x16},
+ {0x07, 0x06},
+ {0x08, 0x98},
+ {0x09, 0xee},
+ {0x50, 0xfc},
+ {0x51, 0x20},
+ {0x52, 0x0b},
+ {0x53, 0x20},
+ {0x54, 0x40},
+ {0x55, 0x10},
+ {0x56, 0x20},
+ //{0x57, 0x40},
+ {0x58, 0xa0},
+ {0x59, 0x28},
+ {0x5a, 0x02},
+ {0x5b, 0x63},
+ {0x5c, 0x34},
+ {0x5d, 0x73},
+ {0x5e, 0x11},
+ {0x5f, 0x40},
+ {0x60, 0x40},
+ {0x61, 0xc8},
+ {0x62, 0xa0},
+ {0x63, 0x40},
+ {0x64, 0x50},
+ {0x65, 0x98},
+ {0x66, 0xfa},
+ {0x67, 0x70},
+ {0x68, 0x58},
+ {0x69, 0x85},
+ {0x6a, 0x40},
+ {0x6b, 0x39},
+ {0x6c, 0x18},
+ {0x6d, 0x28},
+ {0x6e, 0x41},
+ {0x70, 0x02},
+ {0x71, 0x00},
+ {0x72, 0x10},
+ {0x73, 0x40},
+
+ //{0x74, 0x32},
+ //{0x75, 0x40},
+ //{0x76, 0x30},
+ //{0x77, 0x48},
+ //{0x7a, 0x50},
+ //{0x7b, 0x20},
+
+ {0x80, 0x60},
+ {0x81, 0x50},
+ {0x82, 0x42},
+ {0x83, 0x40},
+ {0x84, 0x40},
+ {0x85, 0x40},
+
+ {0x74, 0x40},
+ {0x75, 0x58},
+ {0x76, 0x24},
+ {0x77, 0x40},
+ {0x78, 0x20},
+ {0x79, 0x60},
+ {0x7a, 0x58},
+ {0x7b, 0x20},
+ {0x7c, 0x30},
+ {0x7d, 0x35},
+ {0x7e, 0x10},
+ {0x7f, 0x08},
+
+ ////////////////////ABS////////////////////
+ {0x9c, 0x02},
+ {0x9d, 0x20},
+ //{0x9f, 0x40},
+
+ ////////////////////CC-AWB////////////////////
+ {0xd0, 0x00},
+ {0xd2, 0x2c},
+ {0xd3, 0x80},
+
+ ////////////////////LSC///////////////////
+ //// for xuye062d lens setting
+ {0xfe, 0x01},
+ {0xa0, 0x00},
+ {0xa1, 0x3c},
+ {0xa2, 0x50},
+ {0xa3, 0x00},
+ {0xa8, 0x0f},
+ {0xa9, 0x08},
+ {0xaa, 0x00},
+ {0xab, 0x04},
+ {0xac, 0x00},
+ {0xad, 0x07},
+ {0xae, 0x0e},
+ {0xaf, 0x00},
+ {0xb0, 0x00},
+ {0xb1, 0x09},
+ {0xb2, 0x00},
+ {0xb3, 0x00},
+ {0xb4, 0x31},
+ {0xb5, 0x19},
+ {0xb6, 0x24},
+ {0xba, 0x3a},
+ {0xbb, 0x24},
+ {0xbc, 0x2a},
+ {0xc0, 0x17},
+ {0xc1, 0x13},
+ {0xc2, 0x17},
+ {0xc6, 0x21},
+ {0xc7, 0x1c},
+ {0xc8, 0x1c},
+ {0xb7, 0x00},
+ {0xb8, 0x00},
+ {0xb9, 0x00},
+ {0xbd, 0x00},
+ {0xbe, 0x00},
+ {0xbf, 0x00},
+ {0xc3, 0x00},
+ {0xc4, 0x00},
+ {0xc5, 0x00},
+ {0xc9, 0x00},
+ {0xca, 0x00},
+ {0xcb, 0x00},
+ {0xa4, 0x00},
+ {0xa5, 0x00},
+ {0xa6, 0x00},
+ {0xa7, 0x00},
+
+
+ {0xfe, 0x00},
+ {0x05, 0x00},
+ {0x06, 0x6a},
+ {0x07, 0x00},
+ {0x08, 0x70},
+
+ {0xfe, 0x01},
+ {0x29, 0x00},
+ {0x2a, 0x96},
+
+ {0x2b, 0x02},
+ {0x2c, 0x58},//12 fps
+ {0x2d, 0x02},
+ {0x2e, 0x58},
+ {0x2f, 0x02},//10 fps
+ {0x30, 0x58},
+ {0x31, 0x07},
+ {0x32, 0x08},
+
+
+
+ ////////////20120427////////////////
+ {0xfe,0x01},
+ {0x18,0x22},
+ {0x21,0xc0},
+ {0x06,0x12},
+ {0x08,0x9c},
+ {0x51,0x28},
+ {0x52,0x10},
+ {0x53,0x20},
+ {0x54,0x40},
+ {0x55,0x16},
+ {0x56,0x30},
+ {0x58,0x60},
+ {0x59,0x08},
+ {0x5c,0x35},
+ {0x5d,0x72},
+ {0x67,0x80},
+ {0x68,0x60},
+ {0x69,0x90},
+ {0x6c,0x30},
+ {0x6d,0x60},
+ {0x70,0x10},
+
+ {0xfe,0x00},
+ {0x9c,0x0a},
+ {0xa0,0xaf},
+ {0xa2,0xff},
+ {0xa4,0x60},
+ {0xa5,0x31},
+ {0xa7,0x35},
+ {0x42,0xfe},
+ {0xd1,0x34},
+ {0xd2,0x34},
+ {0xfe,0x00},
+
+
+
+
+
+
+
+ {0xfe, 0x00},
+ ////////////////////asde ///////////////////
+ {0xa0, 0xaf},
+ {0xa2, 0xff},
+
+ {0x44, 0xa2}, // YUV order
+ {0x00, 0x00},
+
+};
+/* 1280X1024 SXGA */
+static struct reginfo sensor_sxga[] =
+{
+ {0x00,0x00}
+};
+
+/* 800X600 SVGA*/
+static struct reginfo sensor_svga[] =
+{
+ {0x0, 0x0},
+};
+
+/* 640X480 VGA */
+static struct reginfo sensor_vga[] =
+{
+
+
+ {0xfe, 0x00},
+ {0x05, 0x00},
+ {0x06, 0x6a},
+ {0x07, 0x00},
+ {0x08, 0x70},
+
+ {0xfe, 0x01},
+ {0x29, 0x00},
+ {0x2a, 0x96},
+
+ {0x2b, 0x02},
+ {0x2c, 0x58},//12 fps
+ {0x2d, 0x02},
+ {0x2e, 0x58},
+ {0x2f, 0x02},//10 fps
+ {0x30, 0x58},
+ {0x31, 0x07},
+ {0x32, 0x08},
+ {0xfe, 0x00},
+
+ {0x00,0x00}
+};
+
+/* 352X288 CIF */
+static struct reginfo sensor_cif[] =
+{
+ {0x00,0x00}
+};
+
+/* 320*240 QVGA */
+static struct reginfo sensor_qvga[] =
+{
+ {0x00,0x00}
+};
+
+/* 176X144 QCIF*/
+static struct reginfo sensor_qcif[] =
+{
+ {0x00,0x00}
+};
+
+static struct reginfo sensor_ClrFmt_YUYV[]=
+{
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_ClrFmt_UYVY[]=
+{
+ {0x00, 0x00}
+};
+
+
+#if CONFIG_SENSOR_WhiteBalance
+static struct reginfo sensor_WhiteB_Auto[]=
+{
+
+ {0x77, 0x57},
+ {0x78, 0x4d},
+ {0x79, 0x45},
+ {0x42, 0xfe},
+ {0x00, 0x00}
+};
+/* Office Colour Temperature : 3500K - 5000K [incandesceny]*/
+static struct reginfo sensor_WhiteB_TungstenLamp1[]=
+{
+ //Office
+ {0x42, 0xfd},
+ {0x77, 0x40},
+ {0x78, 0x58},
+ {0x79, 0x5a},
+ {0x00, 0x00}
+
+};
+/* Home Colour Temperature : 2500K - 3500K [daylight]*/
+static struct reginfo sensor_WhiteB_TungstenLamp2[]=
+{
+ //Home
+ {0x42, 0xfd},
+ {0x77, 0x40},
+ {0x78, 0x56},
+ {0x79, 0x50},
+ {0x00, 0x00}
+};
+
+/* ClearDay Colour Temperature : 5000K - 6500K [fluorescent]*/
+static struct reginfo sensor_WhiteB_ClearDay[]=
+{
+ //Sunny
+ {0x42, 0xfd},
+ {0x77, 0x40},
+ {0x78, 0x58},
+ {0x79, 0x5a},
+ {0x00, 0x00}
+};
+
+/* Cloudy Colour Temperature : 6500K - 8000K */
+static struct reginfo sensor_WhiteB_Cloudy[]=
+{
+ {0x42, 0xfd},
+ {0x77, 0x7a}, //WB_manual_gain
+ {0x78, 0x60},
+ {0x79, 0x40},
+ {0x00, 0x00}
+};
+static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2,
+ sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL,
+};
+#endif
+
+#if CONFIG_SENSOR_Brightness
+static struct reginfo sensor_Brightness0[]=
+{
+ // Brightness -2
+
+ {0xfe, 0x01},
+ {0x13, 0x40},
+ {0xfe, 0x00},
+ {0xd5, 0xe0},
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Brightness1[]=
+{
+ // Brightness -1
+
+ {0xfe, 0x01},
+ {0x13, 0x48},
+ {0xfe, 0x00},
+ {0xd5, 0xf0},
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Brightness2[]=
+{
+ // Brightness 0
+
+
+ {0xfe, 0x01},
+ {0x13, 0x50},
+ {0xfe, 0x00},
+ {0xd5, 0x00},
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Brightness3[]=
+{
+ // Brightness +1
+
+ {0xfe, 0x01},
+ {0x13, 0x58},
+ {0xfe, 0x00},
+ {0xd5, 0x10},
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Brightness4[]=
+{
+ // Brightness +2
+
+ {0xfe, 0x01},
+ {0x13, 0x60},
+ {0xfe, 0x00},
+ {0xd5, 0x20},
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Brightness5[]=
+{
+ // Brightness +3
+
+ {0xfe, 0x01},
+ {0x13, 0x68},
+ {0xfe, 0x00},
+ {0xd5, 0x30},
+ {0x00, 0x00}
+};
+static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3,
+ sensor_Brightness4, sensor_Brightness5,NULL,
+};
+
+#endif
+
+#if CONFIG_SENSOR_Effect
+static struct reginfo sensor_Effect_Normal[] =
+{
+ {0xfe, 0x00},
+ {0x43, 0x00}, //special_effect
+ {0x40, 0xff}, //[7:6]gamma
+ {0x41, 0x22}, //[1]Y_gamma_en
+ {0x42, 0xff}, //[2]ABS [1]AWB
+
+ {0x95, 0x64}, //Edge effect
+ {0x96, 0x82}, //[7:4] edge_max [3:0] edge_th
+ {0x90, 0xbc}, //EEINTP mode 1
+
+ {0x4f, 0x01}, //AEC_en
+ {0xd3, 0x40}, //luma_contrast
+ {0xd4, 0x80}, //contrast_center
+ {0xd5, 0x00}, //luma_offset
+ {0xda, 0x00}, //fixed_Cb
+ {0xdb, 0x00}, //fixed_Cr
+
+ {0xbf, 0x0e}, //RGB gamma
+ {0xc0, 0x1c},
+ {0xc1, 0x34},
+ {0xc2, 0x48},
+ {0xc3, 0x5a},
+ {0xc4, 0x6b},
+ {0xc5, 0x7b},
+ {0xc6, 0x95},
+ {0xc7, 0xab},
+ {0xc8, 0xbf},
+ {0xc9, 0xce},
+ {0xca, 0xd9},
+ {0xcb, 0xe4},
+ {0xcc, 0xec},
+ {0xcd, 0xf7},
+ {0xce, 0xfd},
+ {0xcf, 0xff},
+
+ {0x00,0x00}
+};
+
+static struct reginfo sensor_Effect_WandB[] =
+{
+ {0xfe, 0x00},
+ {0x43, 0x02}, //special_effect
+ {0x40, 0xff}, //[7:6]gamma
+ {0x41, 0x22}, //[1]Y_gamma_en
+ {0x42, 0xff}, //[2]ABS [1]AWB
+
+ {0x95, 0x64}, //Edge effect
+ {0x96, 0x82}, //[7:4] edge_max [3:0] edge_th
+ {0x90, 0xbc}, //EEINTP mode 1
+
+ {0x4f, 0x01}, //AEC_en
+ {0xd3, 0x40}, //luma_contrast
+ {0xd4, 0x80}, //contrast_center
+ {0xd5, 0x00}, //luma_offset
+ {0xda, 0x00}, //fixed_Cb
+ {0xdb, 0x00}, //fixed_Cr
+
+ {0xbf, 0x0e}, //RGB gamma
+ {0xc0, 0x1c},
+ {0xc1, 0x34},
+ {0xc2, 0x48},
+ {0xc3, 0x5a},
+ {0xc4, 0x6b},
+ {0xc5, 0x7b},
+ {0xc6, 0x95},
+ {0xc7, 0xab},
+ {0xc8, 0xbf},
+ {0xc9, 0xce},
+ {0xca, 0xd9},
+ {0xcb, 0xe4},
+ {0xcc, 0xec},
+ {0xcd, 0xf7},
+ {0xce, 0xfd},
+ {0xcf, 0xff},
+
+ {0x00,0x00}
+};
+
+static struct reginfo sensor_Effect_Sepia[] =
+{
+
+ {0xfe, 0x00},
+ {0x43, 0x02}, //special_effect
+ {0x40, 0xff}, //[7:6]gamma
+ {0x41, 0x22}, //[1]Y_gamma_en
+ {0x42, 0xff}, //[2]ABS [1]AWB
+
+ {0x95, 0x64}, //Edge effect
+ {0x96, 0x82}, //[7:4] edge_max [3:0] edge_th
+ {0x90, 0xbc}, //EEINTP mode 1
+
+ {0x4f, 0x01}, //AEC_en
+ {0xd3, 0x40}, //luma_contrast
+ {0xd4, 0x80}, //contrast_center
+ {0xd5, 0x00}, //luma_offset
+ {0xda, 0xd0}, //fixed_Cb
+ {0xdb, 0x28}, //fixed_Cr
+
+ {0xbf, 0x0e}, //RGB gamma
+ {0xc0, 0x1c},
+ {0xc1, 0x34},
+ {0xc2, 0x48},
+ {0xc3, 0x5a},
+ {0xc4, 0x6b},
+ {0xc5, 0x7b},
+ {0xc6, 0x95},
+ {0xc7, 0xab},
+ {0xc8, 0xbf},
+ {0xc9, 0xce},
+ {0xca, 0xd9},
+ {0xcb, 0xe4},
+ {0xcc, 0xec},
+ {0xcd, 0xf7},
+ {0xce, 0xfd},
+ {0xcf, 0xff},
+ {0x00,0x00}
+};
+
+static struct reginfo sensor_Effect_Negative[] =
+{
+ {0xfe, 0x00},
+ {0x43, 0x01}, //special_effect
+ {0x40, 0xff}, //[7:6]gamma
+ {0x41, 0x22}, //[1]Y_gamma_en
+ {0x42, 0xff}, //[2]ABS [1]AWB
+
+ {0x95, 0x64}, //Edge effect
+ {0x96, 0x82}, //[7:4] edge_max [3:0] edge_th
+ {0x90, 0xbc}, //EEINTP mode 1
+
+ {0x4f, 0x01}, //AEC_en
+ {0xd3, 0x40}, //luma_contrast
+ {0xd4, 0x80}, //contrast_center
+ {0xd5, 0x00}, //luma_offset
+ {0xda, 0x00}, //fixed_Cb
+ {0xdb, 0x00}, //fixed_Cr
+
+ {0xbf, 0x0e}, //RGB gamma
+ {0xc0, 0x1c},
+ {0xc1, 0x34},
+ {0xc2, 0x48},
+ {0xc3, 0x5a},
+ {0xc4, 0x6b},
+ {0xc5, 0x7b},
+ {0xc6, 0x95},
+ {0xc7, 0xab},
+ {0xc8, 0xbf},
+ {0xc9, 0xce},
+ {0xca, 0xd9},
+ {0xcb, 0xe4},
+ {0xcc, 0xec},
+ {0xcd, 0xf7},
+ {0xce, 0xfd},
+ {0xcf, 0xff},
+
+ {0x00,0x00}
+};
+
+//SOLARIZE
+static struct reginfo sensor_Effect_Bluish[] =
+{
+ {0xfe, 0x00},
+ {0x43, 0x00}, //special_effect
+ {0x40, 0xff}, //[7:6]gamma
+ {0x41, 0x22}, //[1]Y_gamma_en
+ {0x42, 0xff}, //[2]ABS [1]AWB
+
+ {0x95, 0x64}, //Edge effect
+ {0x96, 0x82}, //[7:4] edge_max [3:0] edge_th
+ {0x90, 0xbc}, //EEINTP mode 1
+
+ {0x4f, 0x01}, //AEC_en
+ {0xd3, 0x40}, //luma_contrast
+ {0xd4, 0x80}, //contrast_center
+ {0xd5, 0x00}, //luma_offset
+ {0xda, 0x00}, //fixed_Cb
+ {0xdb, 0x00}, //fixed_Cr
+
+ {0xbf, 0x10}, //RGB gamma
+ {0xc0, 0x20},
+ {0xc1, 0x38},
+ {0xc2, 0x4e},
+ {0xc3, 0x63},
+ {0xc4, 0x76},
+ {0xc5, 0x87},
+ {0xc6, 0xa2},
+ {0xc7, 0xb4},
+ {0xc8, 0xa8},
+ {0xc9, 0x91},
+ {0xca, 0x7b},
+ {0xcb, 0x66},
+ {0xcc, 0x4f},
+ {0xcd, 0x39},
+ {0xce, 0x24},
+ {0xcf, 0x12},
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Effect_Green[] =
+{
+ //Greenish
+ {0x43,0x02},
+ {0xda,0xc0},
+ {0xdb,0xc0},
+ {0x00,0x00}
+};
+static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia,
+ sensor_Effect_Bluish, sensor_Effect_Green,NULL,
+};
+#endif
+#if CONFIG_SENSOR_Exposure
+static struct reginfo sensor_Exposure0[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Exposure1[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Exposure2[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Exposure3[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Exposure4[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Exposure5[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Exposure6[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3,
+ sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL,
+};
+#endif
+#if CONFIG_SENSOR_Saturation
+static struct reginfo sensor_Saturation0[]=
+{
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Saturation1[]=
+{
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Saturation2[]=
+{
+ {0x00, 0x00}
+};
+static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,};
+
+#endif
+#if CONFIG_SENSOR_Contrast
+static struct reginfo sensor_Contrast0[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Contrast1[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Contrast2[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Contrast3[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Contrast4[]=
+{
+
+ {0x00, 0x00}
+};
+
+
+static struct reginfo sensor_Contrast5[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_Contrast6[]=
+{
+ {0xb3,0x50},
+ {0x00, 0x00}
+};
+static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3,
+ sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL,
+};
+
+#endif
+#if CONFIG_SENSOR_Mirror
+static struct reginfo sensor_MirrorOn[]=
+{
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_MirrorOff[]=
+{
+
+ {0x00, 0x00}
+};
+static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,};
+#endif
+#if CONFIG_SENSOR_Flip
+static struct reginfo sensor_FlipOn[]=
+{
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_FlipOff[]=
+{
+ {0x00, 0x00}
+};
+static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,};
+
+#endif
+#if CONFIG_SENSOR_Scene
+static struct reginfo sensor_SceneAuto[] =
+{
+ {0xfe, 0x01},
+ {0x33, 0x20},
+ {0xfe, 0x00},
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_SceneNight[] =
+{
+ {0xfe, 0x01},
+ {0x33, 0x30},
+ {0xfe, 0x00},
+ {0x00, 0x00}
+};
+static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,};
+
+#endif
+
+#if CONFIG_SENSOR_AntiBanding
+static struct reginfo sensor_AntiBanding_50HZ[] =
+{
+
+{0xfe, 0x00},
+ {0x05, 0x00},
+ {0x06, 0x6a},
+ {0x07, 0x00},
+ {0x08, 0x70},
+
+ {0xfe, 0x01},
+ {0x29, 0x00},
+ {0x2a, 0x96},
+
+ {0x2b, 0x02},
+ {0x2c, 0x58},//12 fps
+ {0x2d, 0x02},
+ {0x2e, 0x58},
+ {0x2f, 0x02},//10 fps
+ {0x30, 0x58},
+ {0x31, 0x07},
+ {0x32, 0x08},
+
+
+{0xfe, 0x00},
+
+ {0x00, 0x00}
+};
+
+static struct reginfo sensor_AntiBanding_60HZ[] =
+{
+ {0xfe, 0x00},
+ {0x05, 0x00},
+ {0x06, 0x6a},
+ {0x07, 0x00},
+ {0x08, 0x89},
+
+ {0xfe, 0x01},
+ {0x29, 0x00},
+ {0x2a, 0x7d},
+
+ {0x2b, 0x02},
+ {0x2c, 0x71},//12 fps
+ {0x2d, 0x02},
+ {0x2e, 0x71},
+ {0x2f, 0x02},//10 fps
+ {0x30, 0x71},
+ {0x31, 0x04},
+ {0x32, 0xe2},
+
+
+{0xfe, 0x00},
+
+
+ {0x00, 0x00}
+};
+static struct reginfo *sensor_AntibandingSeqe[] = {sensor_AntiBanding_50HZ, sensor_AntiBanding_60HZ,NULL,};
+#endif
+
+#if CONFIG_SENSOR_DigitalZoom
+static struct reginfo sensor_Zoom0[] =
+{
+ {0x0, 0x0},
+};
+
+static struct reginfo sensor_Zoom1[] =
+{
+ {0x0, 0x0},
+};
+
+static struct reginfo sensor_Zoom2[] =
+{
+ {0x0, 0x0},
+};
+
+
+static struct reginfo sensor_Zoom3[] =
+{
+ {0x0, 0x0},
+};
+static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,};
+#endif
+static const struct v4l2_querymenu sensor_menus[] =
+{
+ #if CONFIG_SENSOR_WhiteBalance
+ { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,},
+ { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,},
+ { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,},
+ #endif
+
+ #if CONFIG_SENSOR_Effect
+ { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,},
+ { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,},
+ { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,}, //{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,} ,
+ #endif
+
+ #if CONFIG_SENSOR_Scene
+ { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,},
+ #endif
+
+ #if CONFIG_SENSOR_AntiBanding
+ { .id = V4L2_CID_ANTIBANDING, .index = 0, .name = "50hz", .reserved = 0,} ,{ .id = V4L2_CID_ANTIBANDING, .index = 1, .name = "60hz", .reserved = 0,},
+ #endif
+
+ #if CONFIG_SENSOR_Flash
+ { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,},
+ { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,},
+ #endif
+};
+
+static const struct v4l2_queryctrl sensor_controls[] =
+{
+ #if CONFIG_SENSOR_WhiteBalance
+ {
+ .id = V4L2_CID_DO_WHITE_BALANCE,
+ .type = V4L2_CTRL_TYPE_MENU,
+ .name = "White Balance Control",
+ .minimum = 0,
+ .maximum = 4,
+ .step = 1,
+ .default_value = 0,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_Brightness
+ {
+ .id = V4L2_CID_BRIGHTNESS,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Brightness Control",
+ .minimum = -3,
+ .maximum = 2,
+ .step = 1,
+ .default_value = 0,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_Effect
+ {
+ .id = V4L2_CID_EFFECT,
+ .type = V4L2_CTRL_TYPE_MENU,
+ .name = "Effect Control",
+ .minimum = 0,
+ .maximum = 4,
+ .step = 1,
+ .default_value = 0,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_Exposure
+ {
+ .id = V4L2_CID_EXPOSURE,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Exposure Control",
+ .minimum = 0,
+ .maximum = 6,
+ .step = 1,
+ .default_value = 0,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_Saturation
+ {
+ .id = V4L2_CID_SATURATION,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Saturation Control",
+ .minimum = 0,
+ .maximum = 2,
+ .step = 1,
+ .default_value = 0,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_Contrast
+ {
+ .id = V4L2_CID_CONTRAST,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Contrast Control",
+ .minimum = -3,
+ .maximum = 3,
+ .step = 1,
+ .default_value = 0,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_Mirror
+ {
+ .id = V4L2_CID_HFLIP,
+ .type = V4L2_CTRL_TYPE_BOOLEAN,
+ .name = "Mirror Control",
+ .minimum = 0,
+ .maximum = 1,
+ .step = 1,
+ .default_value = 1,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_Flip
+ {
+ .id = V4L2_CID_VFLIP,
+ .type = V4L2_CTRL_TYPE_BOOLEAN,
+ .name = "Flip Control",
+ .minimum = 0,
+ .maximum = 1,
+ .step = 1,
+ .default_value = 1,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_Scene
+ {
+ .id = V4L2_CID_SCENE,
+ .type = V4L2_CTRL_TYPE_MENU,
+ .name = "Scene Control",
+ .minimum = 0,
+ .maximum = 1,
+ .step = 1,
+ .default_value = 0,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_AntiBanding
+ {
+ .id = V4L2_CID_ANTIBANDING,
+ .type = V4L2_CTRL_TYPE_MENU,
+ .name = "antibanding Control",
+ .minimum = 0,
+ .maximum = 1,
+ .step = 1,
+ .default_value = 0,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_DigitalZoom
+ {
+ .id = V4L2_CID_ZOOM_RELATIVE,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "DigitalZoom Control",
+ .minimum = -1,
+ .maximum = 1,
+ .step = 1,
+ .default_value = 0,
+ }, {
+ .id = V4L2_CID_ZOOM_ABSOLUTE,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "DigitalZoom Control",
+ .minimum = 0,
+ .maximum = 3,
+ .step = 1,
+ .default_value = 0,
+ },
+ #endif
+
+ #if CONFIG_SENSOR_Focus
+ {
+ .id = V4L2_CID_FOCUS_RELATIVE,
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .name = "Focus Control",
+ .minimum = -1,
+ .maximum = 1,