Пример #1
0
static int __init goni_init(void)
{
	int ret;

	if (machine_is_aquila()) {
		voice_dai.name = aquila_str[CPU_VOICE_DAI];
		goni_dai[1].cpu_dai_name = aquila_str[CPU_VOICE_DAI];
		goni.name = aquila_str[MACHINE_NAME];
	} else if (!machine_is_goni())
		return -ENODEV;

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

	/* register voice DAI here */
	ret = snd_soc_register_dai(&goni_snd_device->dev, &voice_dai);
	if (ret) {
		platform_device_put(goni_snd_device);
		return ret;
	}

	platform_set_drvdata(goni_snd_device, &goni);
	ret = platform_device_add(goni_snd_device);

	if (ret) {
		snd_soc_unregister_dai(&goni_snd_device->dev);
		platform_device_put(goni_snd_device);
	}

	return ret;
}
Пример #2
0
int s3cfb_set_dualrgb(struct s3cfb_global *ctrl, unsigned int enabled)
{
	struct s3c_platform_fb *pdata = NULL;
	struct s3cfb_lcd *lcd = ctrl->lcd;
	unsigned int cfg = 0;

	pdata = to_fb_plat(ctrl->dev);

	if (enabled) {
		if (machine_is_universal())
			cfg = S3C_DUALRGB_BYPASS_DUAL | S3C_DUALRGB_LINESPLIT |
				S3C_DUALRGB_VDEN_EN_DISABLE;
		#if 0 //mipi_temp
		else if (machine_is_aquila() || pdata->machine_is_cypress)
			cfg = S3C_DUALRGB_BYPASS_DUAL | S3C_DUALRGB_LINESPLIT |
				S3C_DUALRGB_VDEN_EN_ENABLE;
	#endif
	
		/* in case of Line Split mode, MAIN_CNT doesn't neet to set */
		cfg |= S3C_DUALRGB_SUB_CNT(lcd->width/2) | S3C_DUALRGB_MAIN_CNT(0);
	} else
		cfg = 0;

	writel(cfg, ctrl->regs + S3C_DUALRGB);
	dev_dbg(ctrl->dev, "dualrgb = %x\n", readl(ctrl->regs + S3C_DUALRGB));

	return 0;
}
Пример #3
0
static int goni_wm8994_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	int ret;

	/* set endpoints to not connected */
	snd_soc_dapm_nc_pin(dapm, "IN2LP:VXRN");
	snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP");
	snd_soc_dapm_nc_pin(dapm, "LINEOUT1N");
	snd_soc_dapm_nc_pin(dapm, "LINEOUT1P");
	snd_soc_dapm_nc_pin(dapm, "LINEOUT2N");
	snd_soc_dapm_nc_pin(dapm, "LINEOUT2P");

	if (machine_is_aquila()) {
		snd_soc_dapm_nc_pin(dapm, "SPKOUTRN");
		snd_soc_dapm_nc_pin(dapm, "SPKOUTRP");
	}

	/* Headset jack detection */
	ret = snd_soc_jack_new(codec, "Headset Jack",
			SND_JACK_HEADSET | SND_JACK_MECHANICAL | SND_JACK_AVOUT,
			&jack);
	if (ret)
		return ret;

	ret = snd_soc_jack_add_pins(&jack, ARRAY_SIZE(jack_pins), jack_pins);
	if (ret)
		return ret;

	ret = snd_soc_jack_add_gpios(&jack, ARRAY_SIZE(jack_gpios), jack_gpios);
	if (ret)
		return ret;

	return 0;
}