*
* Copyright (c) 2011-2015 REALTEK SEMICONDUCTOR CORP. All rights reserved.
* Author: Johnny Hsu <johnnyhsu@realtek.com>
+ * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
*
* 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
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
+#include <linux/of.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
RT5639_JD1_IN4P_MASK | RT5639_JD2_IN4N_MASK,
RT5639_JD1_IN4P_EN | RT5639_JD2_IN4N_EN);
}
+
rt5639_reg_init(codec);
+
+ if (rt5639->sel_jd_source >= 0)
+ rt5639_soc_update_bits(codec, RT5639_JD_CTRL,
+ RT5639_JD_MASK, rt5639->sel_jd_source << RT5639_JD_SFT);
+
DC_Calibrate(codec);
codec->dapm.bias_level = SND_SOC_BIAS_OFF;
rt5639->codec = codec;
{
struct rt5639_priv *rt5639;
int ret;
+ struct device_node *np;
+ int jd_source;
rt5639 = kzalloc(sizeof(struct rt5639_priv), GFP_KERNEL);
if (NULL == rt5639)
i2c_set_clientdata(i2c, rt5639);
+ rt5639->sel_jd_source = -1;
+ if (i2c->dev.of_node) {
+ np = i2c->dev.of_node;
+ if (of_property_read_u32(np, "sel_jd_source", &jd_source) == 0)
+ rt5639->sel_jd_source = jd_source;
+ }
ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5639,
rt5639_dai, ARRAY_SIZE(rt5639_dai));
if (ret < 0)
*
* Copyright (c) 2011-2013 REALTEK SEMICONDUCTOR CORP. All rights reserved.
* Author: Johnny Hsu <johnnyhsu@realtek.com>
+ * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
*
* 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
unsigned int adb_reg_addr[0x100];
unsigned int adb_reg_value[0x100];
unsigned char adb_reg_num;
+ int sel_jd_source;
};
int rt5639_conn_mux_path(struct snd_soc_codec *codec,