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: <20200818065727.50520-9-vadivel.muruganx.ramuthevar@linux.intel.com>
Date:   Tue, 18 Aug 2020 14:57:26 +0800
From:   "Ramuthevar,Vadivel MuruganX" 
        <vadivel.muruganx.ramuthevar@...ux.intel.com>
To:     linux-kernel@...r.kernel.org, myungjoo.ham@...sung.com,
        cw00.choi@...sung.com
Cc:     andriy.shevchenko@...el.com, thomas.langer@...el.com,
        cheol.yong.kim@...el.com, qi-ming.wu@...el.com, yin1.li@...el.com,
        Ramuthevar Vadivel Murugan 
        <vadivel.muruganx.ramuthevar@...ux.intel.com>
Subject: [PATCH v1 8/9] extcon: extcon-ptn5150: Add USB analog audio accessory support

From: Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar@...ux.intel.com>

Add USB analog audio accessory attached and detection support.

Signed-off-by: Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar@...ux.intel.com>
---
 drivers/extcon/extcon-ptn5150.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5150.c
index b985a5e5c9bc..140994ac43ed 100644
--- a/drivers/extcon/extcon-ptn5150.c
+++ b/drivers/extcon/extcon-ptn5150.c
@@ -34,6 +34,7 @@ enum ptn5150_reg {
 #define PTN5150_DFP_ATTACHED			0x1
 #define PTN5150_UFP_ATTACHED			0x2
 #define PTN5150_DEBUG_ATTACHED			0x3
+#define PTN5150_AUDIO_ATTACHED			0x4
 
 /* Define PTN5150 MASK/SHIFT constant */
 #define PTN5150_REG_DEVICE_ID_VERSION		GENMASK(7, 3)
@@ -63,6 +64,7 @@ static const unsigned int ptn5150_extcon_cable[] = {
 	EXTCON_USB,
 	EXTCON_USB_HOST,
 	EXTCON_JIG,
+	EXTCON_JACK_HEADPHONE,
 	EXTCON_NONE,
 };
 
@@ -89,6 +91,7 @@ static void ptn5150_irq_work(struct work_struct *work)
 	union extcon_property_value flipped;
 	bool host_vbus = false;
 	bool debug = false;
+	bool audio = false;
 	bool host = false;
 	bool dev = false;
 
@@ -158,6 +161,9 @@ static void ptn5150_irq_work(struct work_struct *work)
 			case PTN5150_DEBUG_ATTACHED:
 				debug = true;
 				break;
+			case PTN5150_AUDIO_ATTACHED:
+				audio = true;
+				break;
 			default:
 				dev_err(info->dev,
 					"Unknown Port status : %x\n",
@@ -189,6 +195,7 @@ static void ptn5150_irq_work(struct work_struct *work)
 			    EXTCON_PROP_USB_VBUS, vbus_detected);
 	extcon_set_state_sync(info->edev, EXTCON_USB_HOST, host);
 	extcon_set_state_sync(info->edev, EXTCON_JIG, debug);
+	extcon_set_state_sync(info->edev, EXTCON_JACK_HEADPHONE, audio);
 	extcon_set_state_sync(info->edev, EXTCON_USB, dev);
 
 	mutex_unlock(&info->mutex);
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ