#include "rk616_codec.h"
#if 0
-#define DBG(x...) pr_info(KERN_INFO x)
+#define DBG(x...) pr_info(x)
#else
#define DBG(x...)
#endif
char *command_line = strstr(saved_command_line, "ap_has_alsa=");
if (command_line == NULL) {
- pr_info(KERN_INFO "%s : Can not get ap_has_alsa from kernel command line!\n",
+ pr_info("%s : Can not get ap_has_alsa from kernel command line!\n",
__func__);
return 0;
}
val = kstrtol(command_line, 10, NULL);
if (val == 0 || val == 1) {
rk616_for_mid = (val ? 0 : 1);
- pr_info(KERN_INFO "%s : THIS IS FOR %s\n",
+ pr_info("%s : THIS IS FOR %s\n",
__func__, rk616_for_mid ? "mid" : "phone");
} else {
- pr_info(KERN_INFO "%s : get ap_has_alsa error, val = %d\n",
+ pr_info("%s : get ap_has_alsa error, val = %d\n",
__func__, val);
}
}
}
- pr_info(KERN_INFO "%s : reg error!\n", __func__);
+ pr_err("%s : reg error!\n", __func__);
return -EINVAL;
}
}
}
- pr_info(KERN_INFO "%s : reg error!\n", __func__);
+ pr_err("%s : reg error!\n", __func__);
}
static unsigned int rk616_codec_read(struct snd_soc_codec *codec,
unsigned int value;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616 is NULL\n", __func__);
+ pr_err("%s : rk616 is NULL\n", __func__);
return -EINVAL;
}
if (!rk616_mfd_register(reg) && !rk616_codec_register(codec, reg)) {
- pr_info(KERN_INFO "%s : reg error!\n", __func__);
+ pr_err("%s : reg error!\n", __func__);
return -EINVAL;
}
value = rk616_read_reg_cache(codec, reg);
} else {
if (rk616->read_dev(rk616, reg, &value) < 0) {
- pr_info(KERN_INFO "%s : reg = 0x%x failed\n",
+ pr_err("%s : reg = 0x%x failed\n",
__func__, reg);
return -EIO;
}
int i;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616 is NULL\n", __func__);
+ pr_err("%s : rk616 is NULL\n", __func__);
return -EINVAL;
} else if (!rk616_mfd_register(reg) &&
!rk616_codec_register(codec, reg)) {
- pr_info(KERN_INFO "%s : reg error!\n", __func__);
+ pr_err("%s : reg error!\n", __func__);
return -EINVAL;
}
/* write i2c */
if (rk616->write_dev(rk616, reg, &value) < 0) {
- pr_info(KERN_INFO "%s : reg = 0x%x failed\n",
+ pr_err("%s : reg = 0x%x failed\n",
__func__, reg);
return -EIO;
}
if (new_value != value) {
if (rk616->write_dev(rk616, reg, &new_value) < 0) {
- pr_info(KERN_INFO "%s : reg = 0x%x failed\n",
+ pr_err("%s : reg = 0x%x failed\n",
__func__, reg);
return -EIO;
}
int ret = -1;
if (!rk616 || !rk616->codec) {
- pr_info(KERN_INFO "%s : rk616_priv or rk616_priv->codec is NULL\n",
+ pr_err("%s : rk616_priv or rk616_priv->codec is NULL\n",
__func__);
return -EINVAL;
}
value = (buf[1] & 0xff00) | (0x00ff & buf[2]);
ret = rk616_codec_write(codec, reg, value);
} else {
- pr_info(KERN_INFO "%s : i2c len error\n",
+ pr_err("%s : i2c len error\n",
__func__);
}
struct rk616_codec_priv *rk616 = rk616_priv;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return 0;
}
int i;
if (!rk616 || !rk616->codec) {
- pr_info(KERN_INFO "%s : rk616_priv or rk616_priv->codec is NULL\n",
+ pr_err("%s : rk616_priv or rk616_priv->codec is NULL\n",
__func__);
return -EINVAL;
}
codec = rk616->codec;
- pr_info(KERN_INFO "%s : power up %s %s %s\n", __func__,
+ pr_info("%s : power up %s %s %s\n", __func__,
type & RK616_CODEC_PLAYBACK ? "playback" : "",
type & RK616_CODEC_CAPTURE ? "capture" : "",
type & RK616_CODEC_INCALL ? "incall" : "");
int i;
if (!rk616 || !rk616->codec) {
- pr_info(KERN_INFO "%s : rk616_priv or rk616_priv->codec is NULL\n",
+ pr_err("%s : rk616_priv or rk616_priv->codec is NULL\n",
__func__);
return -EINVAL;
}
codec = rk616->codec;
- pr_info(KERN_INFO "%s : power down %s %s %s\n", __func__,
+ pr_info("%s : power down %s %s %s\n", __func__,
type & RK616_CODEC_PLAYBACK ? "playback" : "",
type & RK616_CODEC_CAPTURE ? "capture" : "",
type & RK616_CODEC_INCALL ? "incall" : "");
struct rk616_codec_priv *rk616 = rk616_priv;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n", __func__);
+ pr_err("%s : rk616_priv is NULL\n", __func__);
return -EINVAL;
}
struct rk616_codec_priv *rk616 = rk616_priv;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
struct rk616_codec_priv *rk616 = rk616_priv;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
long int pre_path;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
struct rk616_codec_priv *rk616 = rk616_priv;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
long int pre_path;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
struct rk616_codec_priv *rk616 = rk616_priv;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
long int pre_path;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
struct rk616_codec_priv *rk616 = rk616_priv;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
long int pre_path;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
struct rk616_codec_priv *rk616 = rk616_priv;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
int set_gpio = 0;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n",
+ pr_err("%s : rk616_priv is NULL\n",
__func__);
return -EINVAL;
}
struct rk616_codec_priv *rk616 = rk616_priv;
if (!rk616 || !rk616_mfd) {
- pr_info(KERN_INFO "%s : %s %s\n",
+ pr_err("%s : %s %s\n",
__func__, !rk616 ? "rk616 is NULL" : "",
!rk616_mfd ? "rk616_mfd is NULL" : "");
return -EINVAL;
adc_aif2 |= RK616_I2S_MODE_MST;
break;
default:
- pr_info(KERN_INFO "%s : set master mask failed!\n",
+ pr_err("%s : set master mask failed!\n",
__func__);
return -EINVAL;
}
dac_aif1 |= RK616_DAC_DF_LJ;
break;
default:
- pr_info(KERN_INFO "%s : set format failed!\n", __func__);
+ pr_err("%s : set format failed!\n", __func__);
return -EINVAL;
}
dac_aif2 |= RK616_DBCLK_POL_DIS;
break;
default:
- pr_info(KERN_INFO "%s : set dai format failed!\n", __func__);
+ pr_err("%s : set dai format failed!\n", __func__);
return -EINVAL;
}
u32 mfd_aif1 = 0, mfd_aif2 = 0, mfd_i2s_ctl = 0;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616 is NULL\n", __func__);
+ pr_err("%s : rk616 is NULL\n", __func__);
return -EINVAL;
}
if ((rk616->stereo_sysclk % (4 * rate * 2) > 0) ||
(div != 16 && div != 20 && div != 24 && div != 32)) {
- pr_info(KERN_INFO "%s : need PLL\n", __func__);
+ pr_err("%s : need PLL\n", __func__);
return -EINVAL;
}
} else {
}
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n", __func__);
+ pr_err("%s : rk616_priv is NULL\n", __func__);
return -EINVAL;
}
struct rk616_codec_priv *rk616 = rk616_priv;
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616 priv is NULL!\n", __func__);
+ pr_err("%s : rk616 priv is NULL!\n", __func__);
return -EINVAL;
}
DBG("%s\n", __func__);
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616 priv is NULL!\n",
+ pr_err("%s : rk616 priv is NULL!\n",
__func__);
return -EINVAL;
}
ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C);
if (ret != 0) {
- pr_info(KERN_INFO "%s : Failed to set cache I/O: %d\n",
+ pr_err("%s : Failed to set cache I/O: %d\n",
__func__, ret);
goto err__;
}
val = snd_soc_read(codec, RK616_RESET);
if (val != rk616_reg_defaults[RK616_RESET] && val != 0x43) {
- pr_info(KERN_INFO "%s : codec register 0: %x is not a 0x00000003\n",
+ pr_err("%s : codec register 0: %x is not a 0x00000003\n",
__func__, val);
ret = -ENODEV;
goto err__;
"Speaker Playback Volume") == 0) {
mixer = (struct soc_mixer_control *)
kcontrol[i].private_value;
- pr_info(KERN_INFO "Speaker Playback Volume mixer->max %d\n",
+ pr_info("Speaker Playback Volume mixer->max %d\n",
mixer->max);
mixer->max = rk616->spk_volume;
mixer->platform_max = rk616->spk_volume;
"Headphone Playback Volume") == 0) {
mixer = (struct soc_mixer_control *)
kcontrol[i].private_value;
- pr_info(KERN_INFO "Headphone Playback Volume mixer->max %d\n",
+ pr_info("Headphone Playback Volume mixer->max %d\n",
mixer->max);
mixer->max = rk616->hp_volume;
mixer->platform_max = rk616->hp_volume;
"Earpiece Playback Volume") == 0) {
mixer = (struct soc_mixer_control *)
kcontrol[i].private_value;
- pr_info(KERN_INFO "Headphone Playback Volume mixer->max %d\n",
+ pr_info("Headphone Playback Volume mixer->max %d\n",
mixer->max);
mixer->max = rk616->spk_volume;
mixer->platform_max = rk616->spk_volume;
DBG("%s\n", __func__);
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616_priv is NULL\n", __func__);
+ pr_err("%s : rk616_priv is NULL\n", __func__);
return 0;
}
*gpio = of_get_named_gpio_flags(node, name, 0, &flags);
if (*gpio < 0) {
- pr_info(KERN_INFO "%s : %s is NULL!\n",
+ pr_err("%s : %s is NULL!\n",
__func__, name);
*gpio = INVALID_GPIO;
} else {
ret = devm_gpio_request(dev, *gpio, name);
if (ret < 0) {
- pr_info(KERN_INFO "%s() %s request ERROR\n",
+ pr_err("%s() %s request ERROR\n",
__func__, name);
return ret;
}
/* set gpio to low level */
ret = gpio_direction_output(*gpio , flags);
if (ret < 0) {
- pr_info(KERN_INFO "%s() %s set ERROR\n",
+ pr_err("%s() %s set ERROR\n",
__func__, name);
return ret;
}
DBG("%s()\n", __func__);
if (!node) {
- pr_info(KERN_INFO "%s() dev->of_node is NULL\n",
+ pr_err("%s() dev->of_node is NULL\n",
__func__);
return -ENODEV;
}
node = of_get_child_by_name(dev->of_node, "rk616-codec");
if (!node) {
- pr_info(KERN_INFO "%s() Can not get child: rk616-codec\n",
+ pr_err("%s() Can not get child: rk616-codec\n",
__func__);
return -ENODEV;
}
ret = rk616_codec_parse_gpio(dev, node,
&rk616->spk_ctl_gpio, "spk-ctl-gpio");
if (ret < 0) {
- pr_info(KERN_INFO "%s() parse gpio : spk-ctl-gpio ERROR\n",
+ pr_err("%s() parse gpio : spk-ctl-gpio ERROR\n",
__func__);
return ret;
}
ret = rk616_codec_parse_gpio(dev, node,
&rk616->hp_ctl_gpio, "hp-ctl-gpio");
if ((ret < 0) && (rk616->hp_ctl_gpio != rk616->spk_ctl_gpio)) {
- pr_info(KERN_INFO "%s() parse gpio : hp-ctl-gpio ERROR\n",
+ pr_err("%s() parse gpio : hp-ctl-gpio ERROR\n",
__func__);
return ret;
}
ret = rk616_codec_parse_gpio(dev, node,
&rk616->rcv_ctl_gpio, "rcv-ctl-gpio");
if (ret < 0) {
- pr_info(KERN_INFO "%s() parse gpio : rcv-ctl-gpio ERROR\n",
+ pr_err("%s() parse gpio : rcv-ctl-gpio ERROR\n",
__func__);
return ret;
}
ret = rk616_codec_parse_gpio(dev, node,
&rk616->mic_sel_gpio, "mic-sel-gpio");
if (ret < 0) {
- pr_info(KERN_INFO "%s() parse gpio : mic-sel-gpio ERROR\n",
+ pr_err("%s() parse gpio : mic-sel-gpio ERROR\n",
__func__);
return ret;
}
DBG("%s\n", __func__);
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616 is NULL\n", __func__);
+ pr_err("%s : rk616 is NULL\n", __func__);
return -EINVAL;
}
rk616_priv = kzalloc(sizeof(struct rk616_codec_priv), GFP_KERNEL);
if (!rk616) {
- pr_info(KERN_INFO "%s : rk616 priv kzalloc failed!\n",
+ pr_err("%s : rk616 priv kzalloc failed!\n",
__func__);
return -ENOMEM;
}
ret = rk616_codec_parse_dt_property(&pdev->dev, rk616_priv);
if (ret < 0) {
- pr_info(KERN_INFO "%s() parse device tree property error %d\n",
+ pr_err("%s() parse device tree property error %d\n",
__func__, ret);
goto err_;
}
ret = snd_soc_register_codec(&pdev->dev,
&soc_codec_dev_rk616, rk616_dai, ARRAY_SIZE(rk616_dai));
if (ret < 0) {
- pr_info(KERN_INFO "%s() register codec error %d\n",
+ pr_err("%s() register codec error %d\n",
__func__, ret);
goto err_;
}
DBG("%s\n", __func__);
if (!rk616 || !rk616->codec) {
- pr_info(KERN_INFO "%s : rk616_priv or rk616_priv->codec is NULL\n",
+ pr_err("%s : rk616_priv or rk616_priv->codec is NULL\n",
__func__);
return;
}