From patchwork Thu Jun 11 12:08:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6587921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4EFFDC0020 for ; Thu, 11 Jun 2015 12:12:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7ACB420645 for ; Thu, 11 Jun 2015 12:12:16 +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 998572063F for ; Thu, 11 Jun 2015 12:12:15 +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 1Z31Ix-0000xh-Bg; Thu, 11 Jun 2015 12:09:55 +0000 Received: from mail-wg0-f48.google.com ([74.125.82.48]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z31Ia-0000bH-9P for linux-arm-kernel@lists.infradead.org; Thu, 11 Jun 2015 12:09:33 +0000 Received: by wgbgq6 with SMTP id gq6so4047893wgb.3 for ; Thu, 11 Jun 2015 05:09:10 -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=vpSxQxihkTcDERKUe7cQ02eFhIROqUz9M6F28u7+/wQ=; b=aDhF4gSlmFZF7zDpZlO4VOFFnME9gV7mPjAZU57Dp1A5zhu/qcgVPCBz2cyLeUGrDe jW35hzd+EZGny5WmCrBSvj+78rkvqUJvOBetNuMr2bLA0eXj0aCWcCtE+SyBGoHFnUbU UONjntXqzvnBRv3BhDz1dDEDYDsX5yXAOBY7UeOZlktv3hzmvveQvD7bQ6Fy5h29vFeo 1Fya15OFPlL0QrnH9eTg2HPUgMn1y9T+AMCcneR+i/Ph44yyvld1p28Q9vQzYNPBAj2Q T5Q4rUKHcZKrnuHyxvOyT3HvrxbezBgObrIUDRrxwiNnkN/RvECsi9SbUadh/pIgctej 01qQ== X-Gm-Message-State: ALoCoQkqfLDAC9xKyG/enYRNsY856TFkI2zDhfJh18OyT1Zd5wpIijkErSr4bftnaXLAAOY8CLLg X-Received: by 10.180.218.195 with SMTP id pi3mr18876932wic.71.1434024550236; Thu, 11 Jun 2015 05:09:10 -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 vz2sm796336wjc.18.2015.06.11.05.09.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 05:09:09 -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 v3 1/4] VFIO: platform: add reset struct and lookup table Date: Thu, 11 Jun 2015 14:08:44 +0200 Message-Id: <1434024527-13869-2-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434024527-13869-1-git-send-email-eric.auger@linaro.org> References: <1434024527-13869-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150611_050932_502160_60958B25 X-CRM114-Status: GOOD ( 11.62 ) 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 containing a single sentinel element. A new type field is added in vfio_platform_device to store what kind of reset is associated to the device, if any. Signed-off-by: Eric Auger --- 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