lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180403221113.GA9463@amd>
Date:   Wed, 4 Apr 2018 00:11:13 +0200
From:   Pavel Machek <pavel@....cz>
To:     Tony Lindgren <tony@...mide.com>
Cc:     Sebastian Reichel <sebastian.reichel@...labora.co.uk>,
        Mark Brown <broonie@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Lee Jones <lee.jones@...aro.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
        linux-omap@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel@...labora.com,
        Dan Williams <dcbw@...hat.com>
Subject: Re: call/normal switch was Re: omap4-droid4: voice call support was

Hi!

> > If you had a register dump from android with mics working, preferably
> > not in speaker mode, perhaps I could try to figure it out?
> 
> OK here are four diffs against starting the phone app for regular
> call, speaker call, and muted versions of them:
> 
> http://muru.com/linux/d4/cpcap/
> 
> Also, I'm connected over cdma right now, not 3g, but I doubt
> that makes a difference for the microphone.

Thanks!

When I apply register settings directly, I indeed get working "normal"
call working. Good. Diff for illustration is below. Clearly needs some
improvements.

And it shows that alsa mixers are expected to be simple and obvious on
D4 -- they just do not work.

Current version of phone gui is at
 https://github.com/pavelmachek/unicsy_demo

- ofono interface should be usable
- AT commands need a lot more work, and they'll probably never work
nicely in this design. They are just a temporary hack.

(ouch, and it should be rewritten, in Vala or better Rust...)
									Pavel

commit 06acc26c318558ed6a50b5a22afffeb9abbe7553
Author: Pavel <pavel@....cz>
Date:   Wed Apr 4 00:04:34 2018 +0200

    Add support for "normal" (not handsfree) call.

diff --git a/sound/soc/codecs/cpcap.c b/sound/soc/codecs/cpcap.c
index 7aaa4db..59c02b7 100644
--- a/sound/soc/codecs/cpcap.c
+++ b/sound/soc/codecs/cpcap.c
@@ -331,7 +331,7 @@ static const char * const cpcap_in_left_mux_texts[] = {
 };
 
 static const char * const cpcap_mode_texts[] = {
-	"Normal", "Call"
+	"Normal", "Handsfree", "Call",
 };
 
 
@@ -464,25 +464,11 @@ static int cpcap_mode_get_enum(struct snd_kcontrol *kcontrol,
 	return 0;
 }
 
-static int cpcap_mode_put_enum(struct snd_kcontrol *kcontrol,
-				     struct snd_ctl_elem_value *ucontrol)
+static int enable_call(struct cpcap_audio *cpcap, int on)
 {
-	struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
-	struct cpcap_audio *cpcap = snd_soc_codec_get_drvdata(codec);
-	struct snd_soc_dapm_context *dapm =
-		snd_soc_dapm_kcontrol_dapm(kcontrol);
-	struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
-	unsigned int muxval = ucontrol->value.enumerated.item[0];
-	unsigned int mask = BIT(e->shift_l);
 	int err;
-
-	printk("Requested mode %d\n", muxval);
-
-	mode = muxval;
-
-	switch (muxval) {
-	case 1:
-
+	unsigned long mask;
+	
 		err = regmap_update_bits(cpcap->regmap, CPCAP_REG_VAUDIOC,
 					 0xffff, 0x0025);	// OK
 		if (err)
@@ -516,6 +502,56 @@ static int cpcap_mode_put_enum(struct snd_kcontrol *kcontrol,
 				   0x0400, 0x0400);
 		if (err)
 			printk("error #1\n");
+
+		return 0;
+out:
+		printk("Error!\n");
+		return -EIO;
+}
+
+static int cpcap_mode_put_enum(struct snd_kcontrol *kcontrol,
+				     struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
+	struct cpcap_audio *cpcap = snd_soc_codec_get_drvdata(codec);
+	struct snd_soc_dapm_context *dapm =
+		snd_soc_dapm_kcontrol_dapm(kcontrol);
+	struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
+	unsigned int muxval = ucontrol->value.enumerated.item[0];
+	unsigned int mask = BIT(e->shift_l);
+	int err;
+
+	printk("Requested mode %d\n", muxval);
+
+	mode = muxval;
+
+	switch (muxval) {
+	case 1:
+		enable_call(cpcap, 1);
+		break;
+	case 2:
+		enable_call(cpcap, 1);
+
+		err = regmap_update_bits(cpcap->regmap, CPCAP_REG_TXI,
+					 0xffff, 0x0cc6);
+		if (err)
+			goto out;
+
+		err = regmap_update_bits(cpcap->regmap, CPCAP_REG_TXMP,
+					 0xffff, 0x0673);
+		if (err)
+			goto out;
+
+
+		err = regmap_update_bits(cpcap->regmap, CPCAP_REG_RXOA,
+					 0xffff, 0x0001);
+		if (err)
+			goto out;
+		
+		err = regmap_update_bits(cpcap->regmap, CPCAP_REG_RXCOA,
+					 0xffff, 0x0601);
+		if (err)
+			goto out;
 		
 	default:
 		break;

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ