All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Chen, Hongzhan" <hongzhan.chen@intel.com>,
	"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [PATCH 2/3] drivers/gpio: core: Introduce helper to find gpiochip
Date: Tue, 31 Aug 2021 09:14:19 +0200	[thread overview]
Message-ID: <3005778f-3d0b-bd98-6b46-fd020fd9868c@siemens.com> (raw)
In-Reply-To: <BN9PR11MB5227700E4BDB4B840D9AB353F2CC9@BN9PR11MB5227.namprd11.prod.outlook.com>

On 31.08.21 09:07, Chen, Hongzhan wrote:
> 
> 
>  -----Original Message-----
>> From: Jan Kiszka <jan.kiszka@siemens.com> 
>> Sent: Tuesday, August 31, 2021 2:48 PM
>> To: Chen, Hongzhan <hongzhan.chen@intel.com>; xenomai@xenomai.org
>> Subject: Re: [PATCH 2/3] drivers/gpio: core: Introduce helper to find gpiochip
>>
>> On 31.08.21 07:07, Hongzhan Chen via Xenomai wrote:
>>> To find gpiochip for non-OF platforms like x86
>>>
>>> Signed-off-by: Hongzhan Chen <hongzhan.chen@intel.com>
>>> ---
>>>  include/cobalt/kernel/rtdm/gpio.h |  7 ++++++
>>>  kernel/drivers/gpio/gpio-core.c   | 42 +++++++++++++++++++++++++++++++
>>>  2 files changed, 49 insertions(+)
>>>
>>> diff --git a/include/cobalt/kernel/rtdm/gpio.h b/include/cobalt/kernel/rtdm/gpio.h
>>> index 29f26d6c6..98279e242 100644
>>> --- a/include/cobalt/kernel/rtdm/gpio.h
>>> +++ b/include/cobalt/kernel/rtdm/gpio.h
>>> @@ -62,6 +62,13 @@ int rtdm_gpiochip_add_by_name(struct rtdm_gpio_chip *rgc,
>>>  int rtdm_gpiochip_post_event(struct rtdm_gpio_chip *rgc,
>>>  			     unsigned int offset);
>>>  
>>> +int rtdm_gpiochip_find(struct device_node *from,
>>> +			  const char *label, int type);
>>> +
>>> +int rtdm_gpiochip_array_find(struct device_node *from,
>>> +				const char *compat[],
>>> +				int nentries, int type);
>>> +
>>>  #ifdef CONFIG_OF
>>>  
>>>  int rtdm_gpiochip_scan_of(struct device_node *from,
>>> diff --git a/kernel/drivers/gpio/gpio-core.c b/kernel/drivers/gpio/gpio-core.c
>>> index ccda67bd1..ce80e8d73 100644
>>> --- a/kernel/drivers/gpio/gpio-core.c
>>> +++ b/kernel/drivers/gpio/gpio-core.c
>>> @@ -528,6 +528,48 @@ int rtdm_gpiochip_add_by_name(struct rtdm_gpio_chip *rgc,
>>>  }
>>>  EXPORT_SYMBOL_GPL(rtdm_gpiochip_add_by_name);
>>>  
>>> +int rtdm_gpiochip_find(struct device_node *from, const char *label,
>>> +			  int type)
>>> +{
>>> +	struct rtdm_gpio_chip *rgc;
>>> +	struct gpio_chip *chip;
>>> +	int ret = -ENODEV;
>>> +
>>> +	if (!rtdm_available())
>>> +		return -ENOSYS;
>>> +
>>> +	chip = find_chip_by_name(label);
>>> +	if (chip == NULL)
>>> +		return ret;
>>> +
>>> +	ret = 0;
>>> +	rgc = rtdm_gpiochip_alloc(chip, type);
>>> +	if (IS_ERR(rgc))
>>> +		ret = PTR_ERR(rgc);
>>> +
>>> +	return ret;
>>> +}
>>> +EXPORT_SYMBOL_GPL(rtdm_gpiochip_find);
>>> +
>>> +int rtdm_gpiochip_array_find(struct device_node *from,
>>> +				const char *compat[],
>>
>> Is "compat" the right argument name here? We are searching by name
>> (label), no?
> 
> Yes , it is label. Let me modify it. So patch 1/3 is accepted ?
> 

Already done that locally while merging. Also just renamed compat_array
to label_array in patch 3. Let me push this then.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


  reply	other threads:[~2021-08-31  7:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  5:07 [PATCH V2 0/3] add support for cherryview gpio controller driver Hongzhan Chen
2021-08-31  5:07 ` [PATCH 1/3] drivers/gpio: core: Move out of OF config conditional compilation Hongzhan Chen
2021-08-31 13:05   ` Jan Kiszka
2021-09-01  1:16     ` Chen, Hongzhan
2021-08-31  5:07 ` [PATCH 2/3] drivers/gpio: core: Introduce helper to find gpiochip Hongzhan Chen
2021-08-31  6:47   ` Jan Kiszka
2021-08-31  7:07     ` Chen, Hongzhan
2021-08-31  7:14       ` Jan Kiszka [this message]
2021-08-31  5:07 ` [PATCH 3/3] driver/gpio: Add Intel Cherryview pinctrl driver Hongzhan Chen
2021-08-31  6:51   ` Jan Kiszka
2021-08-31  7:15 ` [PATCH V2 0/3] add support for cherryview gpio controller driver Jan Kiszka
  -- strict thread matches above, loose matches on Subject: below --
2021-08-30  6:45 [PATCH " Hongzhan Chen
2021-08-30  6:45 ` [PATCH 2/3] drivers/gpio: core: Introduce helper to find gpiochip Hongzhan Chen
2021-04-14  2:16 [PATCH 1/3] rtdm/testing: latmus: introduce latmus driver hongzha1
2021-04-14  2:16 ` [PATCH 2/3] drivers/gpio: core: introduce helper to find gpiochip hongzha1

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=3005778f-3d0b-bd98-6b46-fd020fd9868c@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=hongzhan.chen@intel.com \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.