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: Auger Eric X-Patchwork-Id: 49756 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 84AE020C81 for ; Thu, 11 Jun 2015 12:09:12 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf1433169lbc.2 for ; Thu, 11 Jun 2015 05:09:11 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=vpSxQxihkTcDERKUe7cQ02eFhIROqUz9M6F28u7+/wQ=; b=N+Dp8StBjFIh+YsBoZJin6IFhhsIFIlUbrKqqzlhy2Crq6Pi9pXU+xOiDpYybo/fTz ZZNyLYbQwWSh9JpQX8wIhB8ZdWw4QMmA69l4Ug8Ue70eVm4ZSdECanRBYcJVl5Sa/uiT NVHVb6qk8KOQxRVtJELg6e/D+QVIxODv8r+FcKpPpa1owj0j4wh71WH0rW0l9iIiM3vU Jx8ztkHfVLTfwRmFfftNPvdgqRPkoyU+uxUy0Tr8D/Qb3GATrugu7RhiCVkYCNqLSipB 9Oep5WuFIcrY46lk2jN6AVLh6fVqlhVroxxe3PVfzIiHIXQ7br1tLhSg9zFDyibkUajV gg/g== X-Gm-Message-State: ALoCoQk33GBGE5hhA0XiPe13tbixYzqhAF7XTMapO7txBPSLugREWLgU2qzmrNV3x4xySKbM2Src X-Received: by 10.181.11.197 with SMTP id ek5mr9036665wid.4.1434024551584; Thu, 11 Jun 2015 05:09:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.133 with SMTP id c5ls325579lac.68.gmail; Thu, 11 Jun 2015 05:09:11 -0700 (PDT) X-Received: by 10.112.137.164 with SMTP id qj4mr9464686lbb.105.1434024551423; Thu, 11 Jun 2015 05:09:11 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id dz10si428142lac.88.2015.06.11.05.09.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 05:09:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbtu8 with SMTP id tu8so3022224lbb.2 for ; Thu, 11 Jun 2015 05:09:11 -0700 (PDT) X-Received: by 10.112.204.6 with SMTP id ku6mr9507369lbc.73.1434024551335; Thu, 11 Jun 2015 05:09:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3995585lbb; Thu, 11 Jun 2015 05:09:10 -0700 (PDT) X-Received: by 10.194.87.1 with SMTP id t1mr16428123wjz.24.1434024550483; Thu, 11 Jun 2015 05:09:10 -0700 (PDT) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com. [209.85.212.172]) by mx.google.com with ESMTPS id tn8si855423wjc.133.2015.06.11.05.09.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 05:09:10 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.172 as permitted sender) client-ip=209.85.212.172; Received: by wiwd19 with SMTP id d19so73088785wiw.0 for ; Thu, 11 Jun 2015 05:09:10 -0700 (PDT) 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 Cc: linux-kernel@vger.kernel.org, patches@linaro.org, christoffer.dall@linaro.org 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@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.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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