Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2885818pxa; Tue, 18 Aug 2020 00:02:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8WkrNascSwEQ0y1w9+JAmvW28W4IiHHPYGBZP0cRW7atlHblT40CvI85IlxEQGqSet20a X-Received: by 2002:a05:6402:2069:: with SMTP id bd9mr18137594edb.127.1597734162516; Tue, 18 Aug 2020 00:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597734162; cv=none; d=google.com; s=arc-20160816; b=brMa0F11Az6C/oxMam6GCZFlLkv/8AhLqH5KnMyCFuJIdTYs5gPibKH4o9TopO6OXQ FfPX8gkqpfmT5JdIAoOFAzp3ljew9+AwNItcsITGW/Mpi05ETyqvEN6zt4X1fLU1WqgE mySxIErJO6FKDL08mSvNJiGFP6GLorB5il6sd8mRcCFy/ulVTqVSxrk1pgh9ASM+vRr+ uNZkEGTiEcut+vXbGif0SDOM6g7t/LscZs5FkgOWfnIKMCqOk62zAW5K8F5+4CZUiDiZ TYod7vs3JKTFd0w0aYyNo8s13AmwPoPON9219NJMnyMfYA4Vhtp3grTqPQPPkRyP+TBx OHEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=pkuAVC8QycTabmyk1+ofu3JPnC7r/s1tBn2s5s2CRy0=; b=F4AYWFA1XKfOFePXhZildMGtrkaYcLf2bfoJ6S0Gun2Tght9dGOcepe2NggLPitBzd HtRaVpzrBkoWBfTOAX0mUoYrjYDsC4y7IhG57j+GViHzZ/cXYtJpDN5qlIv/dgb8coqP d3khTI2BPd7V9fXRJqd/7R0rXRGzVetU1Rn9zQAr6R43ubapKcHH+MQQkShoyYj+Sqzj FjUxSx64Od96luYiXpSM66Q7P60QUoONQvnY1v1fgVgmMM46fKWorCcTkLkY/l6cXzOM 5mEImFtE4rrGJy8vIQJXq2kPLGZvXwoU3yRreM2ZvN/B9WbMLb6jZRS6H/jEmQq6qgua 43Rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b19si12601320ejd.405.2020.08.18.00.02.18; Tue, 18 Aug 2020 00:02:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726730AbgHRG6C (ORCPT + 99 others); Tue, 18 Aug 2020 02:58:02 -0400 Received: from mga14.intel.com ([192.55.52.115]:50597 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbgHRG57 (ORCPT ); Tue, 18 Aug 2020 02:57:59 -0400 IronPort-SDR: 96euouaBm3Cg0CKjKMN12PT8Il6KkKXM8zPrtj+c6DZyHl0/VeZBNpSjmWsTg0gEKOK7/2VPNC XF6RpugF9f0Q== X-IronPort-AV: E=McAfee;i="6000,8403,9716"; a="154111276" X-IronPort-AV: E=Sophos;i="5.76,326,1592895600"; d="scan'208";a="154111276" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 23:57:58 -0700 IronPort-SDR: D0VT8o+sVu2DR8zV0Y1kvKjxmtI22otR11ZZN41SK1CfCiK5c3xxE85YUKiV8sjMo5RcoZgjb2 szQftCSxGnrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,326,1592895600"; d="scan'208";a="310342560" Received: from sgsxdev004.isng.intel.com (HELO localhost) ([10.226.88.13]) by orsmga002.jf.intel.com with ESMTP; 17 Aug 2020 23:57:56 -0700 From: "Ramuthevar,Vadivel MuruganX" To: linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com Cc: andriy.shevchenko@intel.com, thomas.langer@intel.com, cheol.yong.kim@intel.com, qi-ming.wu@intel.com, yin1.li@intel.com, Ramuthevar Vadivel Murugan Subject: [PATCH v1 8/9] extcon: extcon-ptn5150: Add USB analog audio accessory support Date: Tue, 18 Aug 2020 14:57:26 +0800 Message-Id: <20200818065727.50520-9-vadivel.muruganx.ramuthevar@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200818065727.50520-1-vadivel.muruganx.ramuthevar@linux.intel.com> References: <20200818065727.50520-1-vadivel.muruganx.ramuthevar@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ramuthevar Vadivel Murugan Add USB analog audio accessory attached and detection support. Signed-off-by: Ramuthevar Vadivel Murugan --- 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