From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2A37C433E0 for ; Mon, 3 Aug 2020 11:15:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E92F20719 for ; Mon, 3 Aug 2020 11:15:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nsVlsdiA"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="A3wQkcvA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E92F20719 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AjfasbZ56Ec05Dj+Hq/mkCTRCTEOTvvzIsMlS6f/Xog=; b=nsVlsdiAjs98qruKKTkbQ8yGo 9Ob1e2uLjosHLGT1DkMC7C6CgLg/ZzpX4U3jnTVtEuMo/CFtCAUDfKiyxfdB3t48B1EmjHdjx3H23 TpQb8OjLsQ+pRX7sriNm+LNk/ZGua00VTGMzpp4uGKE4Kfqx9LB415PjdFxLNws8pWk5cWV1EujK6 bVuTwgBcy+AdRQ40tRaW4zuT/JdopPJ0fn8Sp78o9Ow/iv+XXqYmj7l/tAxEBXjvwbC+pfce6v4cY +mYF54OIfHZyEzlGz8sqYpEtfqWbnape/xClPfBbW0e+iNQ7/vkZyLDghAXnMdPnDUDqihtE8/Z0v KM6E3+k4Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2YQX-0004QQ-1m; Mon, 03 Aug 2020 11:14:45 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2YQU-0004Pb-Ct for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2020 11:14:43 +0000 Received: from localhost (unknown [122.171.202.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 12AA420719; Mon, 3 Aug 2020 11:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596453280; bh=5H3v1Du5rpRSWnXSCSiCk75bAcpRhnq+T5CXif4mD28=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A3wQkcvAaAcrYqHs2CWdwYGBjxzh+8Bv3QZJ+6DfyRGG73tHlo8zhOhR+WHISnB7Z l0is1udwf6mDqCHk5KUWla+ZCRZC5IuCGwzTu3pQaogw4DVeBG4n/VvQz6nNKS/W9N FxApx86IozoVMOwtpMtKUA/hOwlW9sNSBnlbiBo4= Date: Mon, 3 Aug 2020 16:44:36 +0530 From: Vinod Koul To: Peter Ujfalusi Subject: Re: [PATCH 1/2] dmaengine: ti: k3-psil: Use soc_device_match to get the psil map Message-ID: <20200803111436.GN12965@vkoul-mobl> References: <20200803101128.20885-1-peter.ujfalusi@ti.com> <20200803101128.20885-2-peter.ujfalusi@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200803101128.20885-2-peter.ujfalusi@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200803_071442_528978_D3D993EE X-CRM114-Status: GOOD ( 20.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nm@ti.com, grygorii.strashko@ti.com, lokeshvutla@ti.com, nsekhar@ti.com, linux-kernel@vger.kernel.org, kishon@ti.com, dmaengine@vger.kernel.org, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 03-08-20, 13:11, Peter Ujfalusi wrote: > Instead of separate of_machine_is_compatible() it is better to use > soc_device_match() and soc_device_attribute struct to get the PSI-L map > for the booted device. > > By using soc_device_match() it is easier to add support for new devices. > > Signed-off-by: Peter Ujfalusi > --- > drivers/dma/ti/k3-psil.c | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/drivers/dma/ti/k3-psil.c b/drivers/dma/ti/k3-psil.c > index fb7c8150b0d1..3ca29aabac93 100644 > --- a/drivers/dma/ti/k3-psil.c > +++ b/drivers/dma/ti/k3-psil.c > @@ -9,11 +9,18 @@ > #include > #include > #include > +#include > > #include "k3-psil-priv.h" > > static DEFINE_MUTEX(ep_map_mutex); > -static struct psil_ep_map *soc_ep_map; > +static const struct psil_ep_map *soc_ep_map; > + > +static const struct soc_device_attribute k3_soc_devices[] = { > + { .family = "AM65X", .data = &am654_ep_map }, > + { .family = "J721E", .data = &j721e_ep_map }, > + { /* sentinel */ } > +}; > > struct psil_endpoint_config *psil_get_ep_config(u32 thread_id) > { > @@ -21,15 +28,17 @@ struct psil_endpoint_config *psil_get_ep_config(u32 thread_id) > > mutex_lock(&ep_map_mutex); > if (!soc_ep_map) { > - if (of_machine_is_compatible("ti,am654")) { > - soc_ep_map = &am654_ep_map; > - } else if (of_machine_is_compatible("ti,j721e")) { > - soc_ep_map = &j721e_ep_map; > + const struct soc_device_attribute *soc; > + > + soc = soc_device_match(k3_soc_devices); > + if (soc) { > + soc_ep_map = soc->data; > } else { > pr_err("PSIL: No compatible machine found for map\n"); > mutex_unlock(&ep_map_mutex); > return ERR_PTR(-ENOTSUPP); > } > + not related > pr_debug("%s: Using map for %s\n", __func__, soc_ep_map->name); > } > mutex_unlock(&ep_map_mutex); > -- > Peter > > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel