public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Vinod Koul <vkoul@kernel.org>
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
Subject: Re: [PATCH 1/2] dmaengine: ti: k3-psil: Use soc_device_match to get the psil map
Date: Mon, 3 Aug 2020 15:56:44 +0300	[thread overview]
Message-ID: <5ac0498e-8874-4864-c823-d9648c381411@ti.com> (raw)
In-Reply-To: <20200803111436.GN12965@vkoul-mobl>



On 03/08/2020 14.14, Vinod Koul wrote:
> 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 <peter.ujfalusi@ti.com>
>> ---
>>  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 <linux/init.h>
>>  #include <linux/mutex.h>
>>  #include <linux/of.h>
>> +#include <linux/sys_soc.h>
>>  
>>  #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

True, I'll drop it.

> 
>>  		pr_debug("%s: Using map for %s\n", __func__, soc_ep_map->name);
>>  	}
>>  	mutex_unlock(&ep_map_mutex);

Thanks,
- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-08-03 12:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 10:11 [PATCH 0/2] dmaengine: ti: k3-psil: Add support for j7200 Peter Ujfalusi
2020-08-03 10:11 ` [PATCH 1/2] dmaengine: ti: k3-psil: Use soc_device_match to get the psil map Peter Ujfalusi
2020-08-03 11:14   ` Vinod Koul
2020-08-03 12:56     ` Peter Ujfalusi [this message]
2020-08-03 10:11 ` [PATCH 2/2] dmaengine: ti: k3-psil: add map for j7200 Peter Ujfalusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ac0498e-8874-4864-c823-d9648c381411@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=grygorii.strashko@ti.com \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lokeshvutla@ti.com \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox