All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gadre Nayan <gadrenayan@gmail.com>
To: Raul Piper <raulpblooper@gmail.com>
Cc: linux-leds@vger.kernel.org,
	kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: gpio-led driver
Date: Thu, 21 Jul 2016 11:29:01 +0530	[thread overview]
Message-ID: <CAKJ7aR4BxqCK6==0FOVTVVmrawXKw1Z6W5rJs5nwrNPJ+M7p_g@mail.gmail.com> (raw)
In-Reply-To: <CAEwN+MDUmadERvzt01M8D0Yi-G7mVnqBJ6ZyuDk3nJhctMJuzQ@mail.gmail.com>

Hi,

I used this:

/*
* XXX: Use a flat representation of the AM33XX interconnect.
* The real AM33XX interconnect network is quite complex.Since
* that will not bring real advantage to represent that in DT
* for the moment, just use a fake OCP bus entry to represent
* the whole bus hierarchy.
*/
ocp {
          compatible = "simple-bus";
          #address-cells = <1>;
          #size-cells = <1>;
           ranges;
            ti,hwmods = "l3_main";
           .
           .
           .
          dali_gpio {
             compatible = "arm,dali_gpio";
             dali_TX = <9>;
             dali_RX = <10>;
           };
}

Thanks
Nayan Gadre.

On Thu, Jul 21, 2016 at 11:19 AM, Raul Piper <raulpblooper@gmail.com> wrote:
> kindly cc the previous people in "To" .Sorry I missed in while replying you.
>
> On Thu, Jul 21, 2016 at 11:17 AM, Raul Piper <raulpblooper@gmail.com> wrote:
>> HI,
>>
>> On Thu, Jul 21, 2016 at 9:43 AM, Gadre Nayan <gadrenayan@gmail.com> wrote:
>>> Hi,
>>>
>>> OF stands for open firmware, OF uses a format to represent platform
>>> information, which is called a device tree.
>>>
>>> An example of how the driver extracts information from device  tree:
>>>
>>> #if defined(CONFIG_OF)
>>> static const struct of_device_id dali_of_ids[] =
>>> {
>>>        { .compatible = "arm,dali_gpio", },
>>>        {},
>>> };
>>>
>>> MODULE_DEVICE_TABLE(of, dali_of_ids);
>>> #endif
>>>
>>> static struct platform_driver dali_driver = {
>>>         .driver = {
>>>                         .name = "dali_gpio",
>>>                         .of_match_table = of_match_ptr(dali_of_ids),
>>>         },
>>>         .probe = Dali_probe,
>>>         .remove = Dali_remove,
>>> };
>>>
>>> The driver is going to fetch information from the device tree later on
>>> (in probe) using the compatible property mentioned. So if the tree has
>>> the same compatible string then subsequent information can be obtained
>>> from that device tree node.
>>>
>>> Thanks
>>>
>> Can you please post the coresponding dt binding code?
>>
>>> On Thu, Jul 21, 2016 at 9:42 AM, Gadre Nayan <gadrenayan@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> OF stands for open firmware, OF uses a format to represent platform
>>>> information, which is called a device tree.
>>>>
>>>> An example of how the driver extracts information from device  tree:
>>>>
>>>> #if defined(CONFIG_OF)
>>>> static const struct of_device_id dali_of_ids[] =
>>>> {
>>>>        { .compatible = "arm,dali_gpio", },
>>>>        {},
>>>> };
>>>>
>>>> MODULE_DEVICE_TABLE(of, dali_of_ids);
>>>> #endif
>>>>
>>>> static struct platform_driver dali_driver = {
>>>>         .driver = {
>>>>                         .name = "dali_gpio",
>>>>                         .of_match_table = of_match_ptr(dali_of_ids),
>>>>         },
>>>>         .probe = Dali_probe,
>>>>         .remove = Dali_remove,
>>>> };
>>>>
>>>> The driver is going to fetch information from the device tree later on
>>>> (in probe) using the compatible property mentioned. So if the tree has
>>>> the same compatible string then subsequent information can be obtained
>>>> from that device tree node.
>>>>
>>>> Thanks
>>>> Nayan Gadre
>>>>
>>>> On Wed, Jul 20, 2016 at 8:30 PM, Anish Kumar
>>>> <anish198519851985@gmail.com> wrote:
>>>>>
>>>>>
>>>>> On Jul 20, 2016, at 4:15 AM, Raul Piper <raulpblooper@gmail.com> wrote:
>>>>>
>>>>> Hi,
>>>>> I wanted to know the part number
>>>>>
>>>>>
>>>>> What is part number?
>>>>>
>>>>> for the leds-gpio.c in the driver/leds folder and the device tree bindings
>>>>> for this driver .Can some one point out to me where in Linux kernel it is?
>>>>>
>>>>> Also why below line has been used.Is it mandatory?
>>>>> ...
>>>>> .of_match_table = of_gpio_leds_match,
>>>>>
>>>>>
>>>>> This is needed when you are using device tree for getting the board settings
>>>>> but you can also do the same without this as well. Read up on device tree in
>>>>> kernel Documentation folder.
>>>>>
>>>>> },
>>>>>
>>>>> thanks in advance ,
>>>>> Rp
>>>>>
>>>>> _______________________________________________
>>>>> Kernelnewbies mailing list
>>>>> Kernelnewbies@kernelnewbies.org
>>>>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Kernelnewbies mailing list
>>>>> Kernelnewbies@kernelnewbies.org
>>>>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>>>

WARNING: multiple messages have this Message-ID (diff)
From: gadrenayan@gmail.com (Gadre Nayan)
To: kernelnewbies@lists.kernelnewbies.org
Subject: gpio-led driver
Date: Thu, 21 Jul 2016 11:29:01 +0530	[thread overview]
Message-ID: <CAKJ7aR4BxqCK6==0FOVTVVmrawXKw1Z6W5rJs5nwrNPJ+M7p_g@mail.gmail.com> (raw)
In-Reply-To: <CAEwN+MDUmadERvzt01M8D0Yi-G7mVnqBJ6ZyuDk3nJhctMJuzQ@mail.gmail.com>

Hi,

I used this:

/*
* XXX: Use a flat representation of the AM33XX interconnect.
* The real AM33XX interconnect network is quite complex.Since
* that will not bring real advantage to represent that in DT
* for the moment, just use a fake OCP bus entry to represent
* the whole bus hierarchy.
*/
ocp {
          compatible = "simple-bus";
          #address-cells = <1>;
          #size-cells = <1>;
           ranges;
            ti,hwmods = "l3_main";
           .
           .
           .
          dali_gpio {
             compatible = "arm,dali_gpio";
             dali_TX = <9>;
             dali_RX = <10>;
           };
}

Thanks
Nayan Gadre.

On Thu, Jul 21, 2016 at 11:19 AM, Raul Piper <raulpblooper@gmail.com> wrote:
> kindly cc the previous people in "To" .Sorry I missed in while replying you.
>
> On Thu, Jul 21, 2016 at 11:17 AM, Raul Piper <raulpblooper@gmail.com> wrote:
>> HI,
>>
>> On Thu, Jul 21, 2016 at 9:43 AM, Gadre Nayan <gadrenayan@gmail.com> wrote:
>>> Hi,
>>>
>>> OF stands for open firmware, OF uses a format to represent platform
>>> information, which is called a device tree.
>>>
>>> An example of how the driver extracts information from device  tree:
>>>
>>> #if defined(CONFIG_OF)
>>> static const struct of_device_id dali_of_ids[] =
>>> {
>>>        { .compatible = "arm,dali_gpio", },
>>>        {},
>>> };
>>>
>>> MODULE_DEVICE_TABLE(of, dali_of_ids);
>>> #endif
>>>
>>> static struct platform_driver dali_driver = {
>>>         .driver = {
>>>                         .name = "dali_gpio",
>>>                         .of_match_table = of_match_ptr(dali_of_ids),
>>>         },
>>>         .probe = Dali_probe,
>>>         .remove = Dali_remove,
>>> };
>>>
>>> The driver is going to fetch information from the device tree later on
>>> (in probe) using the compatible property mentioned. So if the tree has
>>> the same compatible string then subsequent information can be obtained
>>> from that device tree node.
>>>
>>> Thanks
>>>
>> Can you please post the coresponding dt binding code?
>>
>>> On Thu, Jul 21, 2016 at 9:42 AM, Gadre Nayan <gadrenayan@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> OF stands for open firmware, OF uses a format to represent platform
>>>> information, which is called a device tree.
>>>>
>>>> An example of how the driver extracts information from device  tree:
>>>>
>>>> #if defined(CONFIG_OF)
>>>> static const struct of_device_id dali_of_ids[] =
>>>> {
>>>>        { .compatible = "arm,dali_gpio", },
>>>>        {},
>>>> };
>>>>
>>>> MODULE_DEVICE_TABLE(of, dali_of_ids);
>>>> #endif
>>>>
>>>> static struct platform_driver dali_driver = {
>>>>         .driver = {
>>>>                         .name = "dali_gpio",
>>>>                         .of_match_table = of_match_ptr(dali_of_ids),
>>>>         },
>>>>         .probe = Dali_probe,
>>>>         .remove = Dali_remove,
>>>> };
>>>>
>>>> The driver is going to fetch information from the device tree later on
>>>> (in probe) using the compatible property mentioned. So if the tree has
>>>> the same compatible string then subsequent information can be obtained
>>>> from that device tree node.
>>>>
>>>> Thanks
>>>> Nayan Gadre
>>>>
>>>> On Wed, Jul 20, 2016 at 8:30 PM, Anish Kumar
>>>> <anish198519851985@gmail.com> wrote:
>>>>>
>>>>>
>>>>> On Jul 20, 2016, at 4:15 AM, Raul Piper <raulpblooper@gmail.com> wrote:
>>>>>
>>>>> Hi,
>>>>> I wanted to know the part number
>>>>>
>>>>>
>>>>> What is part number?
>>>>>
>>>>> for the leds-gpio.c in the driver/leds folder and the device tree bindings
>>>>> for this driver .Can some one point out to me where in Linux kernel it is?
>>>>>
>>>>> Also why below line has been used.Is it mandatory?
>>>>> ...
>>>>> .of_match_table = of_gpio_leds_match,
>>>>>
>>>>>
>>>>> This is needed when you are using device tree for getting the board settings
>>>>> but you can also do the same without this as well. Read up on device tree in
>>>>> kernel Documentation folder.
>>>>>
>>>>> },
>>>>>
>>>>> thanks in advance ,
>>>>> Rp
>>>>>
>>>>> _______________________________________________
>>>>> Kernelnewbies mailing list
>>>>> Kernelnewbies at kernelnewbies.org
>>>>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Kernelnewbies mailing list
>>>>> Kernelnewbies at kernelnewbies.org
>>>>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>>>

  parent reply	other threads:[~2016-07-21  5:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 11:15 gpio-led driver Raul Piper
2016-07-20 11:15 ` Raul Piper
2016-07-20 15:00 ` Anish Kumar
2016-07-20 15:00   ` Anish Kumar
2016-07-21  4:12   ` Gadre Nayan
2016-07-21  4:12     ` Gadre Nayan
2016-07-21  4:13     ` Gadre Nayan
2016-07-21  4:13       ` Gadre Nayan
     [not found]       ` <CAEwN+MCSG80LATxpXRcrx7jrUOKizfibseP5sGJvkJn70ZaTFQ@mail.gmail.com>
     [not found]         ` <CAEwN+MDUmadERvzt01M8D0Yi-G7mVnqBJ6ZyuDk3nJhctMJuzQ@mail.gmail.com>
2016-07-21  5:59           ` Gadre Nayan [this message]
2016-07-21  5:59             ` Gadre Nayan
2016-07-20 11:17 Raul Piper
2016-07-20 11:17 ` Raul Piper
2016-07-21  6:40 ` Jacek Anaszewski
2016-07-21  6:40   ` Jacek Anaszewski
2016-07-22 10:10   ` Raul Piper
2016-07-22 14:35     ` Jacek Anaszewski
2016-07-28 11:30       ` Raul Piper

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='CAKJ7aR4BxqCK6==0FOVTVVmrawXKw1Z6W5rJs5nwrNPJ+M7p_g@mail.gmail.com' \
    --to=gadrenayan@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=raulpblooper@gmail.com \
    /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.