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: <1323634328-856-8-git-send-email-jkrzyszt@tis.icnet.pl>
Date:	Sun, 11 Dec 2011 21:12:05 +0100
From:	Janusz Krzysztofik <jkrzyszt@....icnet.pl>
To:	Jarkko Nikula <jarkko.nikula@...mer.com>
Cc:	linux-omap@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	Janusz Krzysztofik <jkrzyszt@....icnet.pl>,
	alsa-devel@...a-project.org, Liam Girdwood <lrg@...com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: [PATCH 07/10] ASoC: OMAP: ams-delta: Drive modem/codec pins over GPIO API

Don't use Amstrad Delta custom I/O functions any longer, replace them
with GPIO. Old pin definitions, no longer used by the modem bits either,
can be dropped.

Depends on patch 2/10 "ARM: OMAP1: Convert Amstrad E3 latches to
basic_mmio_gpio".

Signed-off-by: Janusz Krzysztofik <jkrzyszt@....icnet.pl>
---
 arch/arm/plat-omap/include/plat/board-ams-delta.h |    2 --
 sound/soc/omap/ams-delta.c                        |   21 ++++++++++++---------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/board-ams-delta.h b/arch/arm/plat-omap/include/plat/board-ams-delta.h
index b586078..73fdab9 100644
--- a/arch/arm/plat-omap/include/plat/board-ams-delta.h
+++ b/arch/arm/plat-omap/include/plat/board-ams-delta.h
@@ -34,8 +34,6 @@
 #define AMD_DELTA_LATCH2_KEYBRD_DATA	0x0200
 #define AMD_DELTA_LATCH2_SCARD_RSTIN	0x0400
 #define AMD_DELTA_LATCH2_SCARD_CMDVCC	0x0800
-#define AMS_DELTA_LATCH2_MODEM_NRESET	0x1000
-#define AMS_DELTA_LATCH2_MODEM_CODEC	0x2000
 
 #define AMS_DELTA_GPIO_PIN_KEYBRD_DATA	0
 #define AMS_DELTA_GPIO_PIN_KEYBRD_CLK	1
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index ccb8a6a..389c488 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -268,7 +268,7 @@ static void cx81801_timeout(unsigned long data)
 	/* Reconnect the codec DAI back from the modem to the CPU DAI
 	 * only if digital mute still off */
 	if (!muted)
-		ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_CODEC, 0);
+		gpio_set_value(AMS_DELTA_GPIO_PIN_MODEM_CODEC, 0);
 }
 
 /*
@@ -378,8 +378,7 @@ static void cx81801_receive(struct tty_struct *tty,
 		/* Apply config pulse by connecting the codec to the modem
 		 * if not already done */
 		if (apply)
-			ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_CODEC,
-						AMS_DELTA_LATCH2_MODEM_CODEC);
+			gpio_set_value(AMS_DELTA_GPIO_PIN_MODEM_CODEC, 1);
 		break;
 	}
 }
@@ -438,13 +437,11 @@ static int ams_delta_set_bias_level(struct snd_soc_card *card,
 	case SND_SOC_BIAS_PREPARE:
 	case SND_SOC_BIAS_STANDBY:
 		if (codec->dapm.bias_level == SND_SOC_BIAS_OFF)
-			ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET,
-						AMS_DELTA_LATCH2_MODEM_NRESET);
+			gpio_set_value(AMS_DELTA_GPIO_PIN_MODEM_NRESET, 1);
 		break;
 	case SND_SOC_BIAS_OFF:
 		if (codec->dapm.bias_level != SND_SOC_BIAS_OFF)
-			ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET,
-						0);
+			gpio_set_value(AMS_DELTA_GPIO_PIN_MODEM_NRESET, 0);
 	}
 	codec->dapm.bias_level = level;
 
@@ -468,8 +465,7 @@ static int ams_delta_digital_mute(struct snd_soc_dai *dai, int mute)
 	spin_unlock_bh(&ams_delta_lock);
 
 	if (apply)
-		ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_CODEC,
-				mute ? AMS_DELTA_LATCH2_MODEM_CODEC : 0);
+		gpio_set_value(AMS_DELTA_GPIO_PIN_MODEM_CODEC, mute);
 	return 0;
 }
 
@@ -503,6 +499,13 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
 	int ret;
 	/* Codec is ready, now add/activate board specific controls */
 
+	/*
+	 * *_MODEM_CODEC and *_MODEM_NRESET GPIO pins manipulated above are
+	 * assumed to be already requested from the board initialisation code,
+	 * which should be done while setting up the modem device which those
+	 * pins are used for control of in the first place.
+	 */
+
 	/* Store a pointer to the codec structure for tty ldisc use */
 	cx20442_codec = codec;
 
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ