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: Auger Eric X-Patchwork-Id: 49843 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A8308211FD for ; Mon, 15 Jun 2015 09:10:11 +0000 (UTC) Received: by wibdt2 with SMTP id dt2sf19464580wib.3 for ; Mon, 15 Jun 2015 02:10: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=YjR7Um87NLJ+4DSLvoOp6eD7SSBYStB3QagCH4dfAow=; b=Jn/2tAFa7S0Ob+gx14lnAUi7zNGgVqY2YntDEKXQ2q7pZdrWi3FiEwUgzI7wW0xXUN GgMDqdnj1LLLv1WS4wU+wEmg2ZzPrOBTfjmHbU7YGcJ3YBL1E589FLGckfF+Q3pNObh0 w9g0508DV90wig1pxz0tylFwZZgAvnz7Tch1Sxy2gf8E9d3a6aMf+lQz7pWWhdwTxMKb MkU2tVefUV+DDCRPmoEhfqysqEAP0vWvNz0Vp/crHzClVyfkWmroTy6DuUcFztJxqA5S ufK6wmRYWLpScJFReUjmLV4PY9uaCr+lHYcgSFl0deRrExrfMiJydijK3gZpRTzWBX5M 1p3g== X-Gm-Message-State: ALoCoQkHLc5kJ4Yju57PbbeP40EOUoT8mgStMgprAPvLDkp+gThdHsYt0Q4h9Nr/f72iwaqhVrYM X-Received: by 10.180.106.10 with SMTP id gq10mr18637766wib.0.1434359411019; Mon, 15 Jun 2015 02:10:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.206 with SMTP id q14ls722301lal.58.gmail; Mon, 15 Jun 2015 02:10:10 -0700 (PDT) X-Received: by 10.112.137.1 with SMTP id qe1mr25577396lbb.22.1434359410859; Mon, 15 Jun 2015 02:10:10 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id 8si9983375laj.83.2015.06.15.02.10.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 02:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labbc20 with SMTP id bc20so17282201lab.1 for ; Mon, 15 Jun 2015 02:10:10 -0700 (PDT) X-Received: by 10.112.93.37 with SMTP id cr5mr26490884lbb.106.1434359410746; Mon, 15 Jun 2015 02:10:10 -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 hn6csp1275399lbb; Mon, 15 Jun 2015 02:10:09 -0700 (PDT) X-Received: by 10.180.90.228 with SMTP id bz4mr29726816wib.69.1434359409909; Mon, 15 Jun 2015 02:10:09 -0700 (PDT) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com. [209.85.212.173]) by mx.google.com with ESMTPS id bb10si17239156wib.69.2015.06.15.02.10.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 02:10:09 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.173 as permitted sender) client-ip=209.85.212.173; Received: by wigg3 with SMTP id g3so70321610wig.1 for ; Mon, 15 Jun 2015 02:10:09 -0700 (PDT) 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 Cc: linux-kernel@vger.kernel.org, patches@linaro.org, christoffer.dall@linaro.org 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-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.215.50 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 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