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: 4836451 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CCB24C0338 for ; Wed, 3 Sep 2014 19:39:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E78B120155 for ; Wed, 3 Sep 2014 19:39:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA41E2024D for ; Wed, 3 Sep 2014 19:39:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755756AbaICTjL (ORCPT ); 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vYCN2ATSIEK94Khfwmdve4q78erUzGF24oOKG5xCz/0=; b=WS0LA/L8s7zWHHBeYAYbrUUxmehi8g4VrXr3VosA8uV+h0zN0jbgdt3u/oXNvmHXpH SLTDOkOZqP+JjwasgsAoW/qUDhY2eYmZX0YuIHEO+7X4DDozP3igc8JT9ktNkDZW9VYq dR70B0z7b1YvuwfaU6o1wXL1zkEWBmVBp8JfK8i+X1EDMy3ax2PvEbIjXL3n35wjwI1G Rj91Tx+dw41PuW+sfeCthaqk1TAjKf5shtJ1FtFW2uBv2BVZeQNIh1EuPJV7p/XHTyhx jy0lStvMcxW6u5I+dzAGhOwJXdeeOwmG39SqoPXtvp95NOV6rhwtgB9pj2PCtAq/bxAF BHng== X-Gm-Message-State: ALoCoQnnjqC9qWezzoeYtOVDOSSzp1igdH9d65fu0eHZiKovLVy2YX0cwiwApqDwIY/g9yJkih12 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: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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