From 5d605366dfc92c63cafdb53dd731240b9401317a Mon Sep 17 00:00:00 2001 From: ddl Date: Fri, 17 Dec 2010 17:52:47 +0800 Subject: [PATCH 1/4] defconfig: add camera defconfig --- arch/arm/configs/rk29_sdk_defconfig | 69 ++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/arch/arm/configs/rk29_sdk_defconfig b/arch/arm/configs/rk29_sdk_defconfig index cdd8a43fa9a7..406fba2efc20 100755 --- a/arch/arm/configs/rk29_sdk_defconfig +++ b/arch/arm/configs/rk29_sdk_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.32.27 -# Fri Dec 17 10:31:38 2010 +# Fri Dec 17 17:20:56 2010 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -883,8 +883,73 @@ CONFIG_SSB_POSSIBLE=y # CONFIG_MFD_PCF50633 is not set # CONFIG_AB3100_CORE is not set # CONFIG_REGULATOR is not set -# CONFIG_MEDIA_SUPPORT is not set +CONFIG_MEDIA_SUPPORT=y + +# +# Multimedia core support +# +CONFIG_VIDEO_DEV=y +CONFIG_VIDEO_V4L2_COMMON=y +CONFIG_VIDEO_ALLOW_V4L1=y +CONFIG_VIDEO_V4L1_COMPAT=y +# CONFIG_DVB_CORE is not set +CONFIG_VIDEO_MEDIA=y + +# +# Multimedia drivers +# +# CONFIG_MEDIA_ATTACH is not set +CONFIG_MEDIA_TUNER=y +# CONFIG_MEDIA_TUNER_CUSTOMISE is not set +CONFIG_MEDIA_TUNER_SIMPLE=y +CONFIG_MEDIA_TUNER_TDA8290=y +CONFIG_MEDIA_TUNER_TDA9887=y +CONFIG_MEDIA_TUNER_TEA5761=y +CONFIG_MEDIA_TUNER_TEA5767=y +CONFIG_MEDIA_TUNER_MT20XX=y +CONFIG_MEDIA_TUNER_XC2028=y +CONFIG_MEDIA_TUNER_XC5000=y +CONFIG_MEDIA_TUNER_MC44S803=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_V4L1=y +CONFIG_VIDEOBUF_GEN=y +CONFIG_VIDEOBUF_DMA_CONTIG=y +CONFIG_VIDEO_CAPTURE_DRIVERS=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +CONFIG_VIDEO_HELPER_CHIPS_AUTO=y +# CONFIG_VIDEO_VIVI is not set +# CONFIG_VIDEO_CPIA is not set +# CONFIG_VIDEO_SAA5246A is not set +# CONFIG_VIDEO_SAA5249 is not set +CONFIG_SOC_CAMERA=y +# CONFIG_SOC_CAMERA_MT9M001 is not set +# CONFIG_SOC_CAMERA_MT9M111 is not set +# CONFIG_SOC_CAMERA_MT9T031 is not set +# CONFIG_SOC_CAMERA_MT9V022 is not set +# CONFIG_SOC_CAMERA_TW9910 is not set +# CONFIG_SOC_CAMERA_PLATFORM is not set +# CONFIG_SOC_CAMERA_OV772X is not set +# CONFIG_SOC_CAMERA_OV2655 is not set +CONFIG_SOC_CAMERA_OV2659=y +# CONFIG_SOC_CAMERA_OV9650 is not set +# CONFIG_SOC_CAMERA_OV3640 is not set +CONFIG_SOC_CAMERA_OV5642=y +CONFIG_OV5642_AUTOFOCUS=y +# CONFIG_OV5642_FIXEDFOCUS is not set +# CONFIG_VIDEO_SH_MOBILE_CEU is not set +CONFIG_VIDEO_RK29=y +CONFIG_VIDEO_RK29_WORK_ONEFRAME=y +# CONFIG_VIDEO_RK29_WORK_PINGPONG is not set +CONFIG_VIDEO_RK29_WORK_IPP=y +# CONFIG_VIDEO_RK29_WORK_NOT_IPP is not set +CONFIG_RADIO_ADAPTERS=y +# CONFIG_I2C_SI4713 is not set +# CONFIG_RADIO_SI4713 is not set +# CONFIG_RADIO_SI470X is not set +# CONFIG_RADIO_TEA5764 is not set # CONFIG_SMS_SIANO_MDTV is not set +# CONFIG_DAB is not set # # Graphics support From 12ae78300bbc29e5758d31d287a7ba697883a91b Mon Sep 17 00:00:00 2001 From: fang Date: Fri, 17 Dec 2010 18:09:29 +0800 Subject: [PATCH 2/4] update recode for codec setting --- sound/soc/codecs/wm8900.c | 69 +++++++++++++++++++++++++++++------- sound/soc/rk29/rk29_i2s.c | 4 ++- sound/soc/rk29/rk29_wm8900.c | 36 ++++++++++++++++--- 3 files changed, 91 insertions(+), 18 deletions(-) diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index 14688945d616..f9134b699671 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c @@ -119,8 +119,8 @@ #define WM8900_REG_CLOCKING1_BCLK_MASK (~0x01e) #define WM8900_REG_CLOCKING1_OPCLK_MASK (~0x7000) -#define WM8900_REG_CLOCKING2_ADC_CLKDIV 0xe0 -#define WM8900_REG_CLOCKING2_DAC_CLKDIV 0x1c +#define WM8900_REG_CLOCKING2_ADC_CLKDIV 0x1c +#define WM8900_REG_CLOCKING2_DAC_CLKDIV 0xe0 #define WM8900_REG_DACCTRL_MUTE 0x004 #define WM8900_REG_DACCTRL_DAC_SB_FILT 0x100 @@ -440,11 +440,11 @@ SOC_SINGLE("LINEOUT2 LP -12dB", WM8900_REG_LOUTMIXCTL1, }; -static const struct snd_kcontrol_new wm8900_dapm_loutput2_control = -SOC_DAPM_SINGLE("LINEOUT2L Switch", WM8900_REG_POWER3, 6, 1, 0); +static const struct snd_kcontrol_new wm8900_dapm_loutput2_control[] = { +SOC_DAPM_SINGLE("LINEOUT2L Switch", WM8900_REG_POWER3, 6, 1, 0),}; -static const struct snd_kcontrol_new wm8900_dapm_routput2_control = -SOC_DAPM_SINGLE("LINEOUT2R Switch", WM8900_REG_POWER3, 5, 1, 0); +static const struct snd_kcontrol_new wm8900_dapm_routput2_control[] = { +SOC_DAPM_SINGLE("LINEOUT2R Switch", WM8900_REG_POWER3, 5, 1, 0),}; static const struct snd_kcontrol_new wm8900_loutmix_controls[] = { SOC_DAPM_SINGLE("LINPUT3 Bypass Switch", WM8900_REG_LOUTMIXCTL1, 7, 1, 0), @@ -477,15 +477,20 @@ SOC_DAPM_SINGLE("Input PGA Switch", WM8900_REG_ADCPATH, 2, 1, 0), }; static const struct snd_kcontrol_new wm8900_linpga_controls[] = { -SOC_DAPM_SINGLE("LINPUT1 Switch", WM8900_REG_INCTL, 6, 1, 0), -SOC_DAPM_SINGLE("LINPUT2 Switch", WM8900_REG_INCTL, 5, 1, 0), -SOC_DAPM_SINGLE("LINPUT3 Switch", WM8900_REG_INCTL, 4, 1, 0), +SOC_SINGLE("MIC LINPUT1 Switch", WM8900_REG_INCTL, 6, 1, 0), +SOC_SINGLE("MIC LINPUT2 Switch", WM8900_REG_INCTL, 5, 1, 0), +SOC_SINGLE("MIC LINPUT3 Switch", WM8900_REG_INCTL, 4, 1, 0), }; static const struct snd_kcontrol_new wm8900_rinpga_controls[] = { -SOC_DAPM_SINGLE("RINPUT1 Switch", WM8900_REG_INCTL, 2, 1, 0), -SOC_DAPM_SINGLE("RINPUT2 Switch", WM8900_REG_INCTL, 1, 1, 0), -SOC_DAPM_SINGLE("RINPUT3 Switch", WM8900_REG_INCTL, 0, 1, 0), +SOC_SINGLE("MIC RINPUT1 Switch", WM8900_REG_INCTL, 2, 1, 0), +SOC_SINGLE("MIC RINPUT2 Switch", WM8900_REG_INCTL, 1, 1, 0), +SOC_SINGLE("MIC RINPUT3 Switch", WM8900_REG_INCTL, 0, 1, 0), +}; + +static const struct snd_kcontrol_new wm8900_inmix_controls[] = { +SOC_SINGLE("LINPUT PGA Switch", WM8900_REG_ADCPATH, 6, 1, 0), +SOC_SINGLE("RINPUT PGA Switch", WM8900_REG_ADCPATH, 2, 1, 0), }; static const char *wm9700_lp_mux[] = { "Disabled", "Enabled" }; @@ -687,8 +692,39 @@ static int wm8900_hw_params(struct snd_pcm_substream *substream, snd_soc_write(codec, WM8900_REG_LOUT2CTL, 0x126); snd_soc_write(codec, WM8900_REG_ROUT2CTL, 0x126); snd_soc_write(codec, WM8900_REG_HPCTL1, 0xC0); - } + } else { + snd_soc_write(codec, WM8900_REG_POWER1, 0x211D); + snd_soc_write(codec, WM8900_REG_POWER2, 0xC03F); + + //User for asound.conf File + snd_soc_write(codec, WM8900_REG_LADC_DV, 0x00C1); + snd_soc_write(codec, WM8900_REG_RADC_DV, 0x01C0); + snd_soc_write(codec, WM8900_REG_INCTL, 0x0066); + + snd_soc_write(codec, WM8900_REG_LINVOL, 0x0115); + snd_soc_write(codec, WM8900_REG_RINVOL, 0x0115); + snd_soc_write(codec, WM8900_REG_INBOOSTMIX1, 0x0042); + snd_soc_write(codec, WM8900_REG_INBOOSTMIX2, 0x0042); + snd_soc_write(codec, WM8900_REG_ADCPATH, 0x0077); + + + /* + // MIC to DAC + snd_soc_write(codec, 0x01, 0x211D); + snd_soc_write(codec, 0x02, 0xC03C); + snd_soc_write(codec, 0x03, 0x00EC); + snd_soc_write(codec, 0x16, 0x0115); + snd_soc_write(codec, 0x17, 0x0115); + snd_soc_write(codec, 0x1A, 0x0077); + + snd_soc_write(codec, 0x2E, 0x00DD); + snd_soc_write(codec, 0x35, 0x011F); + snd_soc_write(codec, 0x36, 0x011F); + snd_soc_write(codec, 0x3A, 0x00C0); + */ + } + WM8900_DBG("<<<<<<<<<<<<<<<<<<<private_data; struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; + unsigned int pll_out = 0; + unsigned int lrclk = 0; int ret; DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__); @@ -61,7 +63,7 @@ static int rk29_hw_params(struct snd_pcm_substream *substream, #endif if (ret < 0) return ret; - #if 0 + /* set cpu DAI configuration */ #if defined (CONFIG_SND_RK29_CODEC_SOC_SLAVE) ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | @@ -73,13 +75,39 @@ static int rk29_hw_params(struct snd_pcm_substream *substream, #endif if (ret < 0) return ret; - #endif + } + + switch(params_rate(params)) { + case 8000: + case 16000: + case 24000: + case 32000: + case 48000: + pll_out = 12288000; + break; + case 11025: + case 22050: + case 44100: + pll_out = 11289600; + break; + default: + DBG("Enter:%s, %d, Error rate=%d\n",__FUNCTION__,__LINE__,params_rate(params)); + return -EINVAL; + break; + } + DBG("Enter:%s, %d, rate=%d\n",__FUNCTION__,__LINE__,params_rate(params)); + + pll_out = 12000000; + //snd_soc_dai_set_pll(codec_dai, NULL, 12000000, pll_out); + snd_soc_dai_set_clkdiv(codec_dai, WM8900_BCLK_DIV, WM8900_BCLK_DIV_4); snd_soc_dai_set_clkdiv(codec_dai, WM8900_LRCLK_MODE, 0x400); - snd_soc_dai_set_clkdiv(codec_dai, WM8900_DAC_LRCLK,0x40); - + snd_soc_dai_set_clkdiv(codec_dai, WM8900_DAC_LRCLK,(pll_out/4)/params_rate(params)); + snd_soc_dai_set_clkdiv(codec_dai, WM8900_ADC_LRCLK,(pll_out/4)/params_rate(params)); + DBG("Enter:%s, %d, LRCK=%d\n",__FUNCTION__,__LINE__,(pll_out/4)/params_rate(params)); + return 0; } From 6c5a84de53226ec229b9607802e327cf65062607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B6=9B?= Date: Fri, 17 Dec 2010 22:03:17 +0800 Subject: [PATCH 3/4] support build uu -> o --- Makefile | 4 ++++ scripts/Makefile.build | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 240d6a0743a2..7be29d6c48cd 100644 --- a/Makefile +++ b/Makefile @@ -1596,3 +1596,7 @@ FORCE: # Declare the contents of the .PHONY variable as phony. We keep that # information in a variable so we can use it in if_changed and friends. .PHONY: $(PHONY) + + +%.o: %.uu prepare scripts FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 341b58902ffc..17e8638eabba 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -388,3 +388,12 @@ endif # information in a variable se we can use it in if_changed and friends. .PHONY: $(PHONY) + + +# .uu -> .o +# --------------------------------------------------------------------------- +quiet_cmd_uudecode_o_uu = DECODE $@ + cmd_uudecode_o_uu = uudecode -o $@ $< + +$(obj)/%.o: $(src)/%.uu FORCE + $(call if_changed,uudecode_o_uu) From 510bccc31b572e2f8360f77d7b30b749adb60d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B6=9B?= Date: Fri, 17 Dec 2010 22:32:56 +0800 Subject: [PATCH 4/4] =?UTF-8?q?hannstar=5Fp1003:=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E7=9A=84RT=E5=B7=A5=E4=BD=9C=E9=98=9F?= =?UTF-8?q?=E5=88=97=EF=BC=8C=E6=8F=90=E9=AB=98=E5=93=8D=E5=BA=94=E9=80=9F?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drivers/input/touchscreen/hannstar_p1003.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/hannstar_p1003.c b/drivers/input/touchscreen/hannstar_p1003.c index 726e10a84115..1b3f38cecff9 100755 --- a/drivers/input/touchscreen/hannstar_p1003.c +++ b/drivers/input/touchscreen/hannstar_p1003.c @@ -51,6 +51,7 @@ struct ts_p1003 { struct input_dev *input; char phys[32]; struct delayed_work work; + struct workqueue_struct *wq; struct i2c_client *client; struct multitouch_event mt_event; @@ -96,6 +97,8 @@ static void p1003_report_event(struct ts_p1003 *ts,struct multitouch_event *tc) ts->pendown = pandown; input_sync(input); } + +#if defined (Singltouch_Mode) static void p1003_report_single_event(struct ts_p1003 *ts,struct multitouch_event *tc) { struct input_dev *input = ts->input; @@ -114,6 +117,8 @@ static void p1003_report_single_event(struct ts_p1003 *ts,struct multitouch_even sakura_dbg_report_key_msg("%s x =0x%x,y = 0x%x \n",ts->status?"down":"up",tc->point_data[cid].x,tc->point_data[cid].y); } } +#endif + static inline int p1003_read_values(struct ts_p1003 *ts, struct multitouch_event *tc) { int data; @@ -164,13 +169,9 @@ static void p1003_work(struct work_struct *work) out: if (ts->pendown) - schedule_delayed_work(&ts->work, - msecs_to_jiffies(10)); + queue_delayed_work(ts->wq, &ts->work, msecs_to_jiffies(10)); else enable_irq(ts->irq); - - - return; } static irqreturn_t p1003_irq(int irq, void *handle) @@ -179,8 +180,7 @@ static irqreturn_t p1003_irq(int irq, void *handle) #if 1 if (!ts->get_pendown_state || likely(ts->get_pendown_state())) { disable_irq_nosync(ts->irq); - schedule_delayed_work(&ts->work, - msecs_to_jiffies(10)); + queue_delayed_work(ts->wq, &ts->work, 0); } #endif @@ -228,7 +228,8 @@ static int __devinit p1003_probe(struct i2c_client *client, ts->input = input_dev; ts->status =0 ;// fjp add by 2010-9-30 ts->pendown = 0; // fjp add by 2010-10-06 - + + ts->wq = create_rt_workqueue("p1003_wq"); INIT_DELAYED_WORK(&ts->work, p1003_work); ts->model = pdata->model;