Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2475917imm; Wed, 3 Oct 2018 04:36:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV63LdQcUQ3Lij6fb1sWwAXAGafBmeKcaw+b8LK2F33UtQq/xC9CbWeG3TarM8HUtdZtbxe85 X-Received: by 2002:a17:902:6b06:: with SMTP id o6-v6mr1196098plk.6.1538566579159; Wed, 03 Oct 2018 04:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538566579; cv=none; d=google.com; s=arc-20160816; b=OWGX/SYdYm1ASKVVnaJV/rbbqyF4xdXR6nHgTzC8JVmy0VWwGLy6ZRyeoFR9ssHbEB kKO6ftUu/pG3DXG6xe3pxc9z3defelRxaxAufOmiggJt3NbK20u5OghOr8uS+bF7i/gL ZBUHlEcMIFdg0xasg4lhl1TwkC4Q6ZX6VbwYZ38PcjvYKThB43I6cV4CgVyW+5Rdabuf XyCVj+fAepBKwv/Vx4WgRMELsakrAIflClfVTrHAQJqx2eT19gSVaJ3yzpn6dJKcsCiA tFy8McG/W3G7Yo7N2IfdqdVoe6yEquMlOZpJzDc3BqZCsljYXIcwsGQasCTtZpXIr1UF Wdwg== 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:dmarc-filter:dkim-signature:dkim-signature; bh=nlbls4SMM82VqOqm3FgRSxkMwfxeYkUhYMgG2nL7ZlA=; b=jyN0MAL0TSvdBDgY5D9ip1nWaVss7gyT95pN4cx4Uvcj1I/b8wljjzeCTvR09QjLXf bybr6jHsdNMT1Nd3SatO1cRAWmcx0UzCxMafN+6UuKAf8+WRLggWjkt+4o9w4SjNkguE AthGGJDhQwZepNodBTOj9INtXTYVGV9liMkHzXceOMJfyiA5ALtQ8yig5H50ftaAHiIw rbta5+4gsemJUJcWgstyodQq9UsuyL3nhck70pBA1lx99HPSBmgLW93sVQOj2/uWqabL 0xkdUvOB2jwJZU3is3bUM5lFpXupJ6RJ/dYMFbXHQIYLfyibdbL3dCstT/Vmlq3RhvWG t5tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="MFL/KetA"; dkim=pass header.i=@codeaurora.org header.s=default header.b=O0H5PBh4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16-v6si1047837pge.9.2018.10.03.04.36.04; Wed, 03 Oct 2018 04:36:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="MFL/KetA"; dkim=pass header.i=@codeaurora.org header.s=default header.b=O0H5PBh4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727310AbeJCSXS (ORCPT + 99 others); Wed, 3 Oct 2018 14:23:18 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55648 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbeJCSXS (ORCPT ); Wed, 3 Oct 2018 14:23:18 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3819860C72; Wed, 3 Oct 2018 11:35:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538566517; bh=Dx6hgdqcp5/Sk72Wp06vKywV8EGpB2K6sg2z2s5BXiU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MFL/KetAQlgHVdonGW0gdXqxjjN7/qjono26LcTbr/6Z0k7M0MnGyw7Gfiw5ONQYs rlweLj5dW+9L33/WzjWokmzLje01m58PddB/p+FjpjcyHqPpEBSMn7n5Zg4z3IfNz+ nY3CHO7vORG8nCoqSOhH5Vy/f722vUgSFWYwPPsQ= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id DB7C360C85; Wed, 3 Oct 2018 11:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538566516; bh=Dx6hgdqcp5/Sk72Wp06vKywV8EGpB2K6sg2z2s5BXiU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O0H5PBh4Ec86a9c7wVGhTgenGR/+dnxZoXq0/KSSVQsWPBql3FO/lmUxrDMMNxSjM HbFGn04FylYxe0eLtMcLDfNog7aaDpPMXUClITkvTGS1qLEWcIjXxaNmBTOws4e+WM Tqqe4P1AzVwLq1qwOHxuxvl+fUkFF4eoSC9+S47c= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DB7C360C85 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, sricharan@codeaurora.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH 5/5] rpmsg: glink: Convert the native signals to TIOCM Date: Wed, 3 Oct 2018 17:04:23 +0530 Message-Id: <1538566463-24627-6-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538566463-24627-1-git-send-email-aneela@codeaurora.org> References: <1538566463-24627-1-git-send-email-aneela@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Native signals over SMEM transport are different from Linux TIOCM signals. Add a macro to convert signals when sent or received from clients. Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/qcom_glink_native.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index ff8751b..3054c86 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -211,6 +212,11 @@ struct glink_channel { #define GLINK_FEATURE_INTENTLESS BIT(1) +#define NATIVE_DTR_SIG BIT(31) +#define NATIVE_CTS_SIG BIT(30) +#define NATIVE_CD_SIG BIT(29) +#define NATIVE_RI_SIG BIT(28) + static void qcom_glink_rx_done_work(struct work_struct *work); static struct glink_channel *qcom_glink_alloc_channel(struct qcom_glink *glink, @@ -998,6 +1004,18 @@ static int qcom_glink_handle_signals(struct qcom_glink *glink, } old = channel->rsigs; + + /* convert signals from NATIVE to TIOCM */ + if (signals & NATIVE_DTR_SIG) + signals |= TIOCM_DSR; + if (signals & NATIVE_CTS_SIG) + signals |= TIOCM_CTS; + if (signals & NATIVE_CD_SIG) + signals |= TIOCM_CD; + if (signals & NATIVE_RI_SIG) + signals |= TIOCM_RI; + signals &= 0x0fff; + channel->rsigs = signals; if (channel->ept.sig_cb) @@ -1387,6 +1405,17 @@ static int qcom_glink_set_sigs(struct rpmsg_endpoint *ept, u32 sigs) channel->lsigs = sigs; + /* convert signals from TIOCM to NATIVE */ + sigs &= 0x0fff; + if (sigs & TIOCM_DTR) + sigs |= NATIVE_DTR_SIG; + if (sigs & TIOCM_RTS) + sigs |= NATIVE_CTS_SIG; + if (sigs & TIOCM_CD) + sigs |= NATIVE_CD_SIG; + if (sigs & TIOCM_RI) + sigs |= NATIVE_RI_SIG; + return qcom_glink_send_signals(glink, channel, sigs); } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project