Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30ac6b6e authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

ASoC: dapm: Consistently use unsigned int for register values



Commit f7d3c170 ("ASoC: dapm: Change prototype of soc_widget_read") changed the
signature of soc_widget_read() so that it, instead of return the register value
as a int, takes a pointer to a unsigned int and stores the register value in
that pointer. There are still a few places that pass a int type value to that
function though. Change these to unsigned int. For more consistency also change
the signature of soc_widget_write() to take a unsigned int instead of an int for
the register value.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 38dbfb59
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -386,7 +386,8 @@ static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg,
	return -1;
	return -1;
}
}


static int soc_widget_write(struct snd_soc_dapm_widget *w, int reg, int val)
static int soc_widget_write(struct snd_soc_dapm_widget *w, int reg,
	unsigned int val)
{
{
	if (w->codec)
	if (w->codec)
		return snd_soc_write(w->codec, reg, val);
		return snd_soc_write(w->codec, reg, val);
@@ -506,7 +507,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
	case snd_soc_dapm_switch:
	case snd_soc_dapm_switch:
	case snd_soc_dapm_mixer:
	case snd_soc_dapm_mixer:
	case snd_soc_dapm_mixer_named_ctl: {
	case snd_soc_dapm_mixer_named_ctl: {
		int val;
		unsigned int val;
		struct soc_mixer_control *mc = (struct soc_mixer_control *)
		struct soc_mixer_control *mc = (struct soc_mixer_control *)
			w->kcontrol_news[i].private_value;
			w->kcontrol_news[i].private_value;
		int reg = mc->reg;
		int reg = mc->reg;
@@ -530,7 +531,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
	case snd_soc_dapm_mux: {
	case snd_soc_dapm_mux: {
		struct soc_enum *e = (struct soc_enum *)
		struct soc_enum *e = (struct soc_enum *)
			w->kcontrol_news[i].private_value;
			w->kcontrol_news[i].private_value;
		int val, item;
		unsigned int val, item;


		soc_widget_read(w, e->reg, &val);
		soc_widget_read(w, e->reg, &val);
		item = (val >> e->shift_l) & e->mask;
		item = (val >> e->shift_l) & e->mask;
@@ -559,7 +560,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
	case snd_soc_dapm_value_mux: {
	case snd_soc_dapm_value_mux: {
		struct soc_enum *e = (struct soc_enum *)
		struct soc_enum *e = (struct soc_enum *)
			w->kcontrol_news[i].private_value;
			w->kcontrol_news[i].private_value;
		int val, item;
		unsigned int val, item;


		soc_widget_read(w, e->reg, &val);
		soc_widget_read(w, e->reg, &val);
		val = (val >> e->shift_l) & e->mask;
		val = (val >> e->shift_l) & e->mask;