From patchwork Wed Jul 12 08:22:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souradeep Chowdhury X-Patchwork-Id: 118959 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1007986vqm; Wed, 12 Jul 2023 01:56:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlHs/mwTd6L1BTuM7RagAMNysOZBjSdzyrdGP5fUGmeJwFi8kLuB2F5pvIoisMgyJzsd5qmF X-Received: by 2002:a05:6358:341a:b0:135:46d9:12f7 with SMTP id h26-20020a056358341a00b0013546d912f7mr16547261rwd.26.1689152192581; Wed, 12 Jul 2023 01:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689152192; cv=none; d=google.com; s=arc-20160816; b=xBbCcItM+gBAuHZwJQEDa3q/eJ0s6cArjOUL82suEfszZqwFSYts/5zRnykGXYZ2PO WFup7eDG2JP5JEdEBu0mWAakLmYBI+DZ/kl9ih4XuRVjxrID3kV96khtd1CWGczi8Zpn FDTw6qT5Z6zwjTFwAo7qEdGnh/OhuTMc6yuYpa9NW5phZNHM4BSFHbWLVSSWB/CqadQs ESzAkL9sY5IeGf/p5EzNiTJJoRIxpFT7doRnvtBKoIapDyRgld2nQUW0RWSnfFhVx+TT OmI6JcBthKaMRMBFn/wLoQnp+PX4RaILVbE1ClxLLl1G527aYPJCeIZ3QqoA6KI6GozX dfjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hVzf/h1iQ+R3J36zD1MxGrCE/cAMVqwUd+PVOholWlg=; fh=UtPIuTGaqaJJ37a+crxvtis5z5d56DzPHGVb5d0pt54=; b=hTq6IchbkNvTQsQObzWicUxyw5S3nVUKukYu4qRgSjzCdM9svT4HMNqH3RoMLviD40 ciOi7jnmKIQ01NGqka5kyASu9ytCNtNsjKjuGZgWqlB2Wk1rycysEz3zZ72XvXuAXaa3 THQDWJgMpEISwPcoyiFEdmMEA7y4smbWLjHU0Gg6heh/sP6SlqMsK1+2qQK0+QgR0YHM yL9jR162B/d/kLL8UlbV6M8YdBv8zwxussccrwOT0V7AD5gCRx3UTBhXn7DLndJSBFKK rDnGt9MyKniFJX0ecIIaCLcciclgDjiN/+RVtdCBBXCupZCu1clrkwoIGgrxMif6o5jE /SKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=p04CaScv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 69-20020a630048000000b005428de93a2bsi2789735pga.863.2023.07.12.01.56.19; Wed, 12 Jul 2023 01:56:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=p04CaScv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232461AbjGLI2b (ORCPT + 99 others); Wed, 12 Jul 2023 04:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232819AbjGLI2E (ORCPT ); Wed, 12 Jul 2023 04:28:04 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB6C22D6A; Wed, 12 Jul 2023 01:23:10 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36C6ScJ7013338; Wed, 12 Jul 2023 08:23:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=hVzf/h1iQ+R3J36zD1MxGrCE/cAMVqwUd+PVOholWlg=; b=p04CaScvNvCruN5VQ4vqQxEKZlJNNUsceYXz+uq6aQKQDbK+aoqFVF7kV9+sAjeQ0C2g K4FYfliJLHC8A7uJOh2u+kJjf0KwFi+P1Vp+6V/2LibOcxwohwDjXDhGJNiPCeL87y5g NwkRq5nKKl+oxhY0ZgO4c0RPpoGq0Y7hcOUEXxu6KnTAtFTN9pSkOLifv78JRwhNqWNc DB3ZXHg4tbTZxBTaaSKziH+BHRYKsD7+Us/wp33l6z1r/UyB8OP2+ubeqbEBW0H5WtWe FvhwecTVEnKuO/5Yt16SpD3Tildd7T4AMvrCqZch9wVsINWc+YJjM1LDAkoDmmYOOZwO 1Q== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rsfeq0x7r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jul 2023 08:23:04 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36C8N3lX014311 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jul 2023 08:23:03 GMT Received: from hu-schowdhu-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 12 Jul 2023 01:22:59 -0700 From: Souradeep Chowdhury To: , , Andy Gross , Konrad Dybcio , "Bjorn Andersson" , CC: , , Sibi Sankar , Rajendra Nayak , Souradeep Chowdhury Subject: [PATCH V1 1/3] usb: misc: Add the interface for notifier call for Embedded USB Debugger(EUD) Date: Wed, 12 Jul 2023 13:52:38 +0530 Message-ID: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: HmumV-VRMaraD9yASJM1jw0BP7fj7PtJ X-Proofpoint-GUID: HmumV-VRMaraD9yASJM1jw0BP7fj7PtJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-12_05,2023-07-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=599 suspectscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307120073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771204449676699792 X-GMAIL-MSGID: 1771204449676699792 Add the interface for notifier calls that can be made to check the role switch status of EUD. An external module can import this file and use the wrapper functions eud_register_notify to register a notifier to the EUD notifier chain, eud_unregister_notify to unregister the notifier from the chain, eud_notifier_call_chain to call the notifier chain to check the status of role-switch. These interfaces are provided to handle the case where multiple modules might go for a role-switch on the same port in which case EUD will be given priority over the rest. Signed-off-by: Souradeep Chowdhury --- drivers/usb/misc/qcom_eud_notifier.h | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 drivers/usb/misc/qcom_eud_notifier.h diff --git a/drivers/usb/misc/qcom_eud_notifier.h b/drivers/usb/misc/qcom_eud_notifier.h new file mode 100644 index 000000000000..0cae42a5f6bf --- /dev/null +++ b/drivers/usb/misc/qcom_eud_notifier.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Released under the GPLv2 only. + */ + +#include + +extern int eud_register_notify(struct notifier_block *nb); +extern void eud_unregister_notify(struct notifier_block *nb); +extern void eud_notifier_call_chain(unsigned long role_switch_state);