From patchwork Mon Jun 15 09:09:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6607351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D5B349F326 for ; Mon, 15 Jun 2015 09:13:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1E562041E for ; Mon, 15 Jun 2015 09:13:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B24520416 for ; Mon, 15 Jun 2015 09:13:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z4QPj-0002nD-GD; Mon, 15 Jun 2015 09:10:43 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z4QPW-0002gN-Jn for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2015 09:10:35 +0000 Received: by wiwd19 with SMTP id d19so68365328wiw.0 for ; Mon, 15 Jun 2015 02:10:08 -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=YjR7Um87NLJ+4DSLvoOp6eD7SSBYStB3QagCH4dfAow=; b=dX05RMpwSIgFuy5VmIE4QcD8Z5hYgCBm8dod2bwElVK7Pnm9fJg0v8lqcV9jCFa7i2 Sx/PmDQbCfmJnh9P8i0zwOqaHnwms4l3cj4uVW1zowHIvQ0U5lMQG+xT4Z8pQBcpPUYS ke9W+jToKc3qy9zDmdJwC/K0fB5aDujy7sUOhZzBqviA8wUzWfxUzM0P580ZquywotlO FKVeKAWtfIyqK2GscRMmK2DehBbxOJXZL5lHhZ5X9IfJ8bXPihfBKMNOg7UVqG1/XgW4 BBl6Etk+kUz8uBW1YExxTayT3SFOg5wiGpIURu3hWyExrC47QIbBvZZ+K8Ivmiih2n06 s7+w== X-Gm-Message-State: ALoCoQnrnPfe+byXlJ95jRcAGCEYSfV3XP7upGMgaGLO5MPLYKV6vGqSdSqC5Yjnm3GvYIR71BPJ X-Received: by 10.180.83.40 with SMTP id n8mr29628441wiy.57.1434359408590; Mon, 15 Jun 2015 02:10:08 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by mx.google.com with ESMTPSA id 12sm17920944wjw.17.2015.06.15.02.10.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 02:10:07 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, linux-arm-kernel@lists.infradead.org, b.reynal@virtualopensystems.com, alex.williamson@redhat.com Subject: [PATCH v4 1/4] VFIO: platform: add reset struct and lookup table Date: Mon, 15 Jun 2015 11:09:42 +0200 Message-Id: <1434359385-19916-2-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434359385-19916-1-git-send-email-eric.auger@linaro.org> References: <1434359385-19916-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150615_021030_840557_6A145B8F X-CRM114-Status: GOOD ( 11.78 ) X-Spam-Score: -0.7 (/) Cc: linux-kernel@vger.kernel.org, christoffer.dall@linaro.org, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 This patch introduces the vfio_platform_reset_combo struct that stores all the information useful to handle the reset modality: compat string, name of the reset function, name of the module that implements the reset function. A lookup table of such structures is added, currently void. Signed-off-by: Eric Auger --- v3 -> v4: - update the commit message v2 -> v3: - add const in struct vfio_platform_reset_combo - remove enum vfio_platform_reset_type v2: creation --- drivers/vfio/platform/vfio_platform_common.c | 3 +++ drivers/vfio/platform/vfio_platform_private.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c index abcff7a..611597e 100644 --- a/drivers/vfio/platform/vfio_platform_common.c +++ b/drivers/vfio/platform/vfio_platform_common.c @@ -25,6 +25,9 @@ static DEFINE_MUTEX(driver_lock); +static const struct vfio_platform_reset_combo reset_lookup_table[] = { +}; + static int vfio_platform_regions_init(struct vfio_platform_device *vdev) { int cnt = 0, i; diff --git a/drivers/vfio/platform/vfio_platform_private.h b/drivers/vfio/platform/vfio_platform_private.h index 5d31e04..9e37b9f 100644 --- a/drivers/vfio/platform/vfio_platform_private.h +++ b/drivers/vfio/platform/vfio_platform_private.h @@ -69,6 +69,12 @@ struct vfio_platform_device { int (*get_irq)(struct vfio_platform_device *vdev, int i); }; +struct vfio_platform_reset_combo { + const char *compat; + const char *reset_function_name; + const char *module_name; +}; + extern int vfio_platform_probe_common(struct vfio_platform_device *vdev, struct device *dev); extern struct vfio_platform_device *vfio_platform_remove_common