From: Tien Hock Loh <thloh@altera.com>
To: Tien Hock Loh <thloh@altera.com>
Cc: Josh Cartwright <joshc@codeaurora.org>,
robh+dt@kernel.org, pawel.moll@arm.com,
Mark Rutland <mark.rutland@arm.com>,
ijc+devicetree@hellion.org.uk, Kumar Gala <galak@codeaurora.org>,
Rob Landley <rob@landley.net>,
Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
Grant Likely <grant.likely@linaro.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
dinguyen@altera.com, "lftan@altera.com" <lftan@altera.com>
Subject: Re: [PATCH V7 1/1] drivers/gpio: Altera soft IP GPIO driver and devicetree binding
Date: Mon, 7 Apr 2014 16:00:43 +0800 [thread overview]
Message-ID: <CAOLUe6aPWmkJJSiBLL8tmw2MNfpaeLpSp3CSwP1u7q+qXxCh9Q@mail.gmail.com> (raw)
In-Reply-To: <CAOLUe6aspffO1PUjKWW7ejpbxnYtb+RKRQrK=y30kuF7KXUUhA@mail.gmail.com>
On Wed, Mar 19, 2014 at 6:09 PM, Tien Hock Loh <thloh@altera.com> wrote:
> On Fri, Mar 7, 2014 at 11:14 PM, Josh Cartwright <joshc@codeaurora.org> wrote:
>> On Mon, Mar 03, 2014 at 06:27:43PM +0800, thloh@altera.com wrote:
>>> From: Tien Hock Loh <thloh@altera.com>
>>>
>>> Add driver support for Altera GPIO soft IP, including interrupts and I/O.
>>> Tested on Altera CV SoC board using dipsw and LED using LED framework.
>>>
>>> Signed-off-by: Tien Hock Loh <thloh@altera.com>
>>> ---
>>
>>> + return -ENOMEM;
>>> + }
>>> + altera_gc->domain = 0;
>>> +
>>> + spin_lock_init(&altera_gc->gpio_lock);
>>> +
>>> + id = pdev->id;
>>> +
>>> + if (of_property_read_u32(node, "altr,gpio-bank-width", ®))
>>> + /*By default assume full GPIO controller*/
>>> + altera_gc->mmchip.gc.ngpio = 32;
>>> + else
>>> + altera_gc->mmchip.gc.ngpio = reg;
>>> +
>>> + if (altera_gc->mmchip.gc.ngpio > 32) {
>>> + dev_warn(&pdev->dev,
>>> + "ngpio is greater than 32, defaulting to 32\n");
>>> + altera_gc->mmchip.gc.ngpio = 32;
>>> + }
>>> +
>>> + altera_gc->mmchip.gc.direction_input = altera_gpio_direction_input;
>>> + altera_gc->mmchip.gc.direction_output = altera_gpio_direction_output;
>>> + altera_gc->mmchip.gc.get = altera_gpio_get;
>>> + altera_gc->mmchip.gc.set = altera_gpio_set;
>>> + altera_gc->mmchip.gc.to_irq = altera_gpio_to_irq;
>>> + altera_gc->mmchip.gc.owner = THIS_MODULE;
>>> +
>>> + ret = of_mm_gpiochip_add(node, &altera_gc->mmchip);
>>> + if (ret) {
>>> + dev_err(&pdev->dev, "Failed adding memory mapped gpiochip\n");
>>> + return ret;
>>> + }
>>> +
>>> + platform_set_drvdata(pdev, altera_gc);
>>> +
>>> + altera_gc->mapped_irq = irq_of_parse_and_map(node, 0);
>>>
>>
>> platform_get_irq(pdev, 0);
>>
> OK.
>
platform_get_irq doesn't create the irq mapping which is needed by the
driver. Since this driver is targeted at using of, should I be using
irq_of_parse_and_map or should I still redo the codes with
platform_get_irq and irq_create_mapping? I think the latter would be
introducing code redundancy. Please advice.
Thanks.
next prev parent reply other threads:[~2014-04-07 8:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-03 10:27 [PATCH V7 1/1] drivers/gpio: Altera soft IP GPIO driver and devicetree binding thloh
2014-03-07 3:31 ` Linus Walleij
2014-03-08 11:50 ` Gerhard Sittig
2014-03-12 14:52 ` Linus Walleij
2014-03-07 15:14 ` Josh Cartwright
2014-03-19 10:09 ` Tien Hock Loh
2014-04-07 8:00 ` Tien Hock Loh [this message]
2014-04-07 17:11 ` Josh Cartwright
2014-04-21 2:21 ` Tien Hock Loh
2014-04-29 14:14 ` Grant Likely
2014-04-15 10:00 ` Tien Hock Loh
2014-03-08 11:44 ` Gerhard Sittig
2014-03-31 10:38 ` Tien Hock Loh
2014-04-23 13:32 ` Linus Walleij
2014-04-24 0:55 ` Tien Hock Loh
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=CAOLUe6aPWmkJJSiBLL8tmw2MNfpaeLpSp3CSwP1u7q+qXxCh9Q@mail.gmail.com \
--to=thloh@altera.com \
--cc=devicetree@vger.kernel.org \
--cc=dinguyen@altera.com \
--cc=galak@codeaurora.org \
--cc=gnurou@gmail.com \
--cc=grant.likely@linaro.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=joshc@codeaurora.org \
--cc=lftan@altera.com \
--cc=linus.walleij@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=rob@landley.net \
--cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).