From patchwork Wed Sep 3 19:38:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashwin Chaugule X-Patchwork-Id: 36633 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 61C2C2039B for ; Wed, 3 Sep 2014 19:39:36 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id eu11sf86692626pac.11 for ; Wed, 03 Sep 2014 12:39:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=2nDRLHb9ibEavkCPzOVp7LXjIHu2SR9xbnUdMuPN510=; b=h4kfFlvHJmI8aEkAZk5NyNZGyOdtTYMvKYa2Iy5RmfULJDJSgJg2lvgWjnCLEMknr0 7g5iE1+Cw5T2DYAko1aoZvif0RzRqkhHnbnmlH7w0GvnEh60OKFqwvyrgLPvwd5YyI/O aiUOTtFGnQZW7zn6BHH4pUjQIMlZSaSAFzPc9MRNVtMRBK/sMjSEftMLbUmXl+/V2TD4 V1a3yjHnO69e9nYfT9sb/X89IEYfu3ys4f1bomPAp73OQakCP/ZaoVodEeb779tAXtxF 9OnCz/kNgN8VAVqcnVbG5ij9Fp6HoiBkkTaiLe4L2MnCItUn0B5SgW7zl8dLbGLoPxRz m14Q== X-Gm-Message-State: ALoCoQmeS8ScEdccfGY2lt4ZTrH4mXLHGYCs+im4fIPHPFZa4NZH2hKms2GhnnaAhfL0t0+UW/tI X-Received: by 10.66.168.197 with SMTP id zy5mr15944183pab.7.1409773173203; Wed, 03 Sep 2014 12:39:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.6 with SMTP id q6ls3081393qgd.82.gmail; Wed, 03 Sep 2014 12:39:33 -0700 (PDT) X-Received: by 10.220.132.207 with SMTP id c15mr37327562vct.12.1409773173102; Wed, 03 Sep 2014 12:39:33 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id h8si1518550vdu.73.2014.09.03.12.39.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 12:39:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id la4so9608247vcb.9 for ; Wed, 03 Sep 2014 12:39:32 -0700 (PDT) X-Received: by 10.220.97.138 with SMTP id l10mr36996298vcn.25.1409773172916; Wed, 03 Sep 2014 12:39:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp729645vcb; Wed, 3 Sep 2014 12:39:32 -0700 (PDT) X-Received: by 10.67.5.68 with SMTP id ck4mr62245884pad.6.1409773172016; Wed, 03 Sep 2014 12:39:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ni10si13086437pbc.51.2014.09.03.12.39.25 for ; Wed, 03 Sep 2014 12:39:26 -0700 (PDT) Received-SPF: none (google.com: linux-acpi-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755756AbaICTjL (ORCPT + 7 others); Wed, 3 Sep 2014 15:39:11 -0400 Received: from mail-yh0-f44.google.com ([209.85.213.44]:53217 "EHLO mail-yh0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755805AbaICTjK (ORCPT ); Wed, 3 Sep 2014 15:39:10 -0400 Received: by mail-yh0-f44.google.com with SMTP id a41so5647087yho.31 for ; Wed, 03 Sep 2014 12:39:09 -0700 (PDT) X-Received: by 10.236.19.196 with SMTP id n44mr64721443yhn.83.1409773149860; Wed, 03 Sep 2014 12:39:09 -0700 (PDT) Received: from localhost.localdomain (cpe-098-027-049-158.nc.res.rr.com. [98.27.49.158]) by mx.google.com with ESMTPSA id p27sm7661072yhd.1.2014.09.03.12.39.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Sep 2014 12:39:09 -0700 (PDT) From: Ashwin Chaugule To: arnd@arndb.de Cc: linux-acpi@vger.kernel.org, linaro-acpi@lists.linaro.org, rjw@rjwysocki.net, broonie@kernel.org, Ashwin Chaugule Subject: [PATCH v4 1/4] Mailbox: Prepare to add PCC Mailbox support Date: Wed, 3 Sep 2014 15:38:56 -0400 Message-Id: <1409773139-10356-2-git-send-email-ashwin.chaugule@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409773139-10356-1-git-send-email-ashwin.chaugule@linaro.org> References: <1409773139-10356-1-git-send-email-ashwin.chaugule@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ashwin.chaugule@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Restructure code to allow extending the Mailbox functionality for PCC (Platform Communication Channel) as a Mailbox. Signed-off-by: Ashwin Chaugule --- drivers/mailbox/mailbox.c | 10 +++------- include/linux/mailbox_controller.h | 4 ++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 63ecc17..5866412 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -21,12 +21,8 @@ #include #include -#define TXDONE_BY_IRQ BIT(0) /* controller has remote RTR irq */ -#define TXDONE_BY_POLL BIT(1) /* controller can read status of last TX */ -#define TXDONE_BY_ACK BIT(2) /* S/W ACK recevied by Client ticks the TX */ - -static LIST_HEAD(mbox_cons); -static DEFINE_MUTEX(con_mutex); +LIST_HEAD(mbox_cons); +DEFINE_MUTEX(con_mutex); static int add_to_rbuf(struct mbox_chan *chan, void *mssg) { @@ -107,7 +103,7 @@ static void tx_tick(struct mbox_chan *chan, int r) complete(&chan->tx_complete); } -static void poll_txdone(unsigned long data) +void poll_txdone(unsigned long data) { struct mbox_controller *mbox = (struct mbox_controller *)data; bool txdone, resched = false; diff --git a/include/linux/mailbox_controller.h b/include/linux/mailbox_controller.h index 9ee195b..956cc06 100644 --- a/include/linux/mailbox_controller.h +++ b/include/linux/mailbox_controller.h @@ -15,6 +15,10 @@ struct mbox_chan; +#define TXDONE_BY_IRQ BIT(0) /* controller has remote RTR irq */ +#define TXDONE_BY_POLL BIT(1) /* controller can read status of last TX */ +#define TXDONE_BY_ACK BIT(2) /* S/W ACK recevied by Client ticks the TX */ + /** * struct mbox_chan_ops - methods to control mailbox channels * @send_data: The API asks the MBOX controller driver, in atomic