From patchwork Mon Dec 11 23:43:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 121484 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3432077qgn; Mon, 11 Dec 2017 15:47:15 -0800 (PST) X-Google-Smtp-Source: ACJfBotKnKLIrKAM7W0e2vPtb9r7V42s+hmBk4HJRho49iR7p4dyYKFVIj9LCtHA+kE2B2aQAiR/ X-Received: by 10.28.118.4 with SMTP id r4mr23092wmc.71.1513036034967; Mon, 11 Dec 2017 15:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513036034; cv=none; d=google.com; s=arc-20160816; b=iiKBnP9e34FnxYw5BxTxnpSG1O+9bekq5mhaInyHO/zAyr55qzm3+UCn4nYu8Q9HNQ 0RmHIed7LupekgmHpg8X+7GeUed5FK8XKQdC6e63UBPrZ6GwgoLyqjPcBhWqYNBf4MQM PvqHnIqmEwbE4xi3e6NIIxHVEXzUHEhkAkd+1TY4ILzo+un+kABbhCxVkVp22XkI2ylh Lpp2453zn2Hq4YXzTrSJPAdWnCcqMFH72NZBluiQ0nQiaRxkxOgEqvMFZ/2kPNqn1v11 aYRl/8bXm6C4DmF60lry6juFKrx6TNvG1PPa7IXupsQE0xzgiEtpP9zQEOxJ4gu5iLHm 0p7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to:arc-authentication-results; bh=bobwrR0TOnGI7aNGeH7XFbHwwjfFQ4lnVCWo4HG7fDs=; b=dLGhSMaxv12NnlfXE3wF2AfJ2zsWdZiVi9BNGZxiVYqDBUBVuL9Wyin15idd4eKjPK Rhr4y0d/eb+eaBB8JBJB1evHSBDxbL5Wx2oOlXSzA9PQc5GNjJvOnOj005ZhQzBuScsg VhDIRTc/TixKFIt8lWT110E+9MXHuuRldO0pTHT0jhNDJFfhWqrn98OjVMlXJuZbFOij 4F7Xv6V7M/DyRC171KgpVs9BMB0Lc9xoZQs7JVtqg+AsCPC5TK3W39uZYHmZli281Drv pfZQdD+9nJzHYSJl7QrZSWPJFQIu6zAMzEDHnPWW6JaavI+lURV4LH6ozDEJifykrqXw R7nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=h+VgyRH4; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id x83si6072199wmg.13.2017.12.11.15.47.14; Mon, 11 Dec 2017 15:47:14 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=h+VgyRH4; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E3056267702; Tue, 12 Dec 2017 00:45:30 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9FE632676D5; Tue, 12 Dec 2017 00:45:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by alsa0.perex.cz (Postfix) with ESMTP id 273D52676D5 for ; Tue, 12 Dec 2017 00:45:25 +0100 (CET) Received: by mail-wr0-f193.google.com with SMTP id h1so19289895wre.12 for ; Mon, 11 Dec 2017 15:45:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=m5fuV9rRvWZc/You+YmM0UYXnMGafyyzentCXPDdM2Y=; b=h+VgyRH4v6Yw1HxlY/H0rFC+ixzLud5mu/21SojItN/1xL2jsD2hLqDEHa/LSN75Lc U1tDPvF50XKJnfaHBY+UBraJCvEdBdjZ/bzP8NrTsFqF1y5hkg4miukcVdSHJkCAkcb9 UYCjXBwSK3xuLTe4GRbSNGai0hXyYWDC8QrEU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=m5fuV9rRvWZc/You+YmM0UYXnMGafyyzentCXPDdM2Y=; b=sGIfTC+aoSDW2GOmbK2/mywDBRdKV2ZWPjCkv81gpKzSp4LRuGUrj6CvmBWySSlfJD nkYTfGAXMdzOyUY28XXTy/pCSKBSTkB5rUgasuCiA7VKASTR03BC+rZI8JPsqRE2lkXA 2pTncUN+tz0FHblnsCiMaaWHT1+hpQe1RK0xrPbV9JtS/7u4SKOIcPsMmIr58ROAMnns ApOIGAzorcl/HiWT9qYrDDdPojCatmdO9dYbaNnTOaYiYvVxHbAJyH19tA58QJHKkLCx aR2yN93pnUI/5NITLZIC1kMOvis3XUmcKuFa/uSEYAnDce+6aZoH2wUmk8wbL9Do7YnQ 9HAQ== X-Gm-Message-State: AKGB3mJz2A+GCux6yTG2uL7sWjKqeAfOsnohi8toUJaA984sK0+78CE4 tx/gxb9mGMyHmeN6WI/Uw6mBFA== X-Received: by 10.223.174.147 with SMTP id y19mr1794964wrc.97.1513035925575; Mon, 11 Dec 2017 15:45:25 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id k69sm10673615wmg.8.2017.12.11.15.45.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Dec 2017 15:45:24 -0800 (PST) From: srinivas.kandagatla@linaro.org To: Mark Brown , Greg Kroah-Hartman , alsa-devel@alsa-project.org Date: Mon, 11 Dec 2017 23:43:03 +0000 Message-Id: <20171211234307.14465-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171211234307.14465-1-srinivas.kandagatla@linaro.org> References: <20171211234307.14465-1-srinivas.kandagatla@linaro.org> Cc: Mark Rutland , devicetree@vger.kernel.org, Jonathan Corbet , linux-arm-msm@vger.kernel.org, linux-doc@vger.kernel.org, j.neuschaefer@gmx.net, linux-kernel@vger.kernel.org, Rob Herring , Srinivas Kandagatla , pombredanne@nexb.com, sdharia@codeaurora.org Subject: [alsa-devel] [PATCH v10 09/13] slimbus: core: add common defines required for controllers X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org From: Srinivas Kandagatla This patch adds some common constant defines which are required for qcom slim controller driver. Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/slimbus.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) -- 2.15.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/drivers/slimbus/slimbus.h b/drivers/slimbus/slimbus.h index db089134f673..79f8e05d92dd 100644 --- a/drivers/slimbus/slimbus.h +++ b/drivers/slimbus/slimbus.h @@ -11,9 +11,38 @@ #include #include +/* Standard values per SLIMbus spec needed by controllers and devices */ +#define SLIM_CL_PER_SUPERFRAME 6144 +#define SLIM_CL_PER_SUPERFRAME_DIV8 (SLIM_CL_PER_SUPERFRAME >> 3) + /* SLIMbus message types. Related to interpretation of message code. */ #define SLIM_MSG_MT_CORE 0x0 +/* + * SLIM Broadcast header format + * BYTE 0: MT[7:5] RL[4:0] + * BYTE 1: RSVD[7] MC[6:0] + * BYTE 2: RSVD[7:6] DT[5:4] PI[3:0] + */ +#define SLIM_MSG_MT_MASK GENMASK(2, 0) +#define SLIM_MSG_MT_SHIFT 5 +#define SLIM_MSG_RL_MASK GENMASK(4, 0) +#define SLIM_MSG_RL_SHIFT 0 +#define SLIM_MSG_MC_MASK GENMASK(6, 0) +#define SLIM_MSG_MC_SHIFT 0 +#define SLIM_MSG_DT_MASK GENMASK(1, 0) +#define SLIM_MSG_DT_SHIFT 4 + +#define SLIM_HEADER_GET_MT(b) ((b >> SLIM_MSG_MT_SHIFT) & SLIM_MSG_MT_MASK) +#define SLIM_HEADER_GET_RL(b) ((b >> SLIM_MSG_RL_SHIFT) & SLIM_MSG_RL_MASK) +#define SLIM_HEADER_GET_MC(b) ((b >> SLIM_MSG_MC_SHIFT) & SLIM_MSG_MC_MASK) +#define SLIM_HEADER_GET_DT(b) ((b >> SLIM_MSG_DT_SHIFT) & SLIM_MSG_DT_MASK) + +/* Device management messages used by this framework */ +#define SLIM_MSG_MC_REPORT_PRESENT 0x1 +#define SLIM_MSG_MC_ASSIGN_LOGICAL_ADDRESS 0x2 +#define SLIM_MSG_MC_REPORT_ABSENT 0xF + /* Clock pause Reconfiguration messages */ #define SLIM_MSG_MC_BEGIN_RECONFIGURATION 0x40 #define SLIM_MSG_MC_NEXT_PAUSE_CLOCK 0x4A @@ -94,6 +123,10 @@ struct slim_msg_txn { #define DEFINE_SLIM_BCAST_TXN(name, mc, rl, la, msg) \ struct slim_msg_txn name = { rl, 0, mc, SLIM_MSG_DEST_BROADCAST, 0,\ 0, la, msg, } + +#define DEFINE_SLIM_EDEST_TXN(name, mc, rl, la, msg) \ + struct slim_msg_txn name = { rl, 0, mc, SLIM_MSG_DEST_ENUMADDR, 0,\ + 0, la, msg, } /** * enum slim_clk_state: SLIMbus controller's clock state used internally for * maintaining current clock state.