Boot 如何传输参数

setenv boardargs "codec=wm8976"

save

Mach_smdkc110.c(arch/arm/mach_s5pv210)

//********** wang+ for codec (wm8976, rt5621) *************
char g_selected_codec[32] = "wm8976";
EXPORT_SYMBOL(g_selected_codec);

static int __init select_codec(char *str)
{
 printk("select_codec: str=%s\n", str);
 strcpy(g_selected_codec, str);
}

__setup("codec=", select_codec);
//********** wang+ for codec *************

Smdkv2xx_wm8976.c(sound/soc/s3c24xx)

static int __init smdkv2xx_audio_init(void)
{
       int ret;
       WM8976_DEBUG(" smdkv210_audio_init start\n");
       extern char g_selected_codec[];
 #if 1 //wang
         if(!strcmp(g_selected_codec, "wm8976")){
                 printk("smdk2xx_wm8976 ::->smdkv2xx_audio_init ........ wm8976 ok\n");
          }
         else

{
                printk("smdk2xx_wm8976 ::->smdkv2xx_audio_init ........ wm8976 out\n");
                return 0;
         }
 #endif 
        smdkv210_audio_clk_init();

smdkv2xx_snd_device = platform_device_alloc("soc-audio", -1);
      if (!smdkv2xx_snd_device)
      return -ENOMEM;

ut_check_i2s_board_type();

platform_set_drvdata(smdkv2xx_snd_device, &smdkv2xx_snd_devdata);
     smdkv2xx_snd_devdata.dev = &smdkv2xx_snd_device->dev;

ret = platform_device_add(smdkv2xx_snd_device);
     if (ret)
     platform_device_put(smdkv2xx_snd_device);

//add by urbetter
     speaker_scan_init();
     printk("smdkv2xx_audio_init done\n");
     return ret;
}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwdzjj.html