From: noralf@tronnes.org (Noralf Trønnes)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3 v4] ARM: bcm2835: Add the Raspberry Pi firmware driver
Date: Fri, 29 May 2015 00:43:46 +0200 [thread overview]
Message-ID: <55679A22.2090909@tronnes.org> (raw)
In-Reply-To: <87r3q072gl.fsf@eliezer.anholt.net>
Den 29.05.2015 00:38, skrev Eric Anholt:
> Noralf Tr?nnes <noralf@tronnes.org> writes:
>
>> Den 28.05.2015 20:33, skrev Eric Anholt:
>>> This gives us a function for making mailbox property channel requests
>>> of the firmware, which is most notable in that it will let us get and
>>> set clock rates.
>>>
>>> Signed-off-by: Eric Anholt <eric@anholt.net>
>> ...
>>> +static int rpi_firmware_probe(struct platform_device *pdev)
>>> +{
>>> + struct device *dev = &pdev->dev;
>>> + struct rpi_firmware *fw;
>>> +
>>> + fw = devm_kzalloc(dev, sizeof(*fw), GFP_KERNEL);
>>> + if (!fw)
>>> + return -ENOMEM;
>>> +
>>> + fw->cl.dev = dev;
>>> + fw->cl.rx_callback = response_callback;
>>> + fw->cl.tx_block = true;
>>> +
>>> + fw->chan = mbox_request_channel(&fw->cl, 0);
>>> + if (IS_ERR(fw->chan)) {
>>> + int ret = PTR_ERR(fw->chan);
>>> + if (ret != -EPROBE_DEFER)
>>> + dev_err(dev, "Failed to get mbox channel: %d\n", ret);
>>> + return ret;
>>> + }
>>> +
>>> + init_completion(&fw->c);
>>> +
>>> + platform_set_drvdata(pdev, fw);
>>> +
>>> + rpi_firmware_print_firmware_revision(dev);
>>> +
>>> + return 0;
>>> +}
>>> +
>>> +static int rpi_firmware_remove(struct platform_device *pdev)
>>> +{
>>> + struct rpi_firmware *fw = platform_get_drvdata(pdev);
>>> +
>>> + mbox_free_channel(fw->chan);
>> I guess driver data has to be reset here:
>> platform_set_drvdata(pdev, NULL);
> Fixed.
>
I was wrong about this one as Stephen pointed out.
My point became mute now that rpi_firmware_property_list() doesn't look
up driver data anymore.
WARNING: multiple messages have this Message-ID (diff)
From: "Noralf Trønnes" <noralf-L59+Z2yzLopAfugRpC6u6w@public.gmane.org>
To: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/3 v4] ARM: bcm2835: Add the Raspberry Pi firmware driver
Date: Fri, 29 May 2015 00:43:46 +0200 [thread overview]
Message-ID: <55679A22.2090909@tronnes.org> (raw)
In-Reply-To: <87r3q072gl.fsf-omZaPlIz5HhaEpDpdNBo/KxOck334EZe@public.gmane.org>
Den 29.05.2015 00:38, skrev Eric Anholt:
> Noralf Trønnes <noralf-L59+Z2yzLopAfugRpC6u6w@public.gmane.org> writes:
>
>> Den 28.05.2015 20:33, skrev Eric Anholt:
>>> This gives us a function for making mailbox property channel requests
>>> of the firmware, which is most notable in that it will let us get and
>>> set clock rates.
>>>
>>> Signed-off-by: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
>> ...
>>> +static int rpi_firmware_probe(struct platform_device *pdev)
>>> +{
>>> + struct device *dev = &pdev->dev;
>>> + struct rpi_firmware *fw;
>>> +
>>> + fw = devm_kzalloc(dev, sizeof(*fw), GFP_KERNEL);
>>> + if (!fw)
>>> + return -ENOMEM;
>>> +
>>> + fw->cl.dev = dev;
>>> + fw->cl.rx_callback = response_callback;
>>> + fw->cl.tx_block = true;
>>> +
>>> + fw->chan = mbox_request_channel(&fw->cl, 0);
>>> + if (IS_ERR(fw->chan)) {
>>> + int ret = PTR_ERR(fw->chan);
>>> + if (ret != -EPROBE_DEFER)
>>> + dev_err(dev, "Failed to get mbox channel: %d\n", ret);
>>> + return ret;
>>> + }
>>> +
>>> + init_completion(&fw->c);
>>> +
>>> + platform_set_drvdata(pdev, fw);
>>> +
>>> + rpi_firmware_print_firmware_revision(dev);
>>> +
>>> + return 0;
>>> +}
>>> +
>>> +static int rpi_firmware_remove(struct platform_device *pdev)
>>> +{
>>> + struct rpi_firmware *fw = platform_get_drvdata(pdev);
>>> +
>>> + mbox_free_channel(fw->chan);
>> I guess driver data has to be reset here:
>> platform_set_drvdata(pdev, NULL);
> Fixed.
>
I was wrong about this one as Stephen pointed out.
My point became mute now that rpi_firmware_property_list() doesn't look
up driver data anymore.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: "Noralf Trønnes" <noralf@tronnes.org>
To: Eric Anholt <eric@anholt.net>, linux-arm-kernel@lists.infradead.org
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3 v4] ARM: bcm2835: Add the Raspberry Pi firmware driver
Date: Fri, 29 May 2015 00:43:46 +0200 [thread overview]
Message-ID: <55679A22.2090909@tronnes.org> (raw)
In-Reply-To: <87r3q072gl.fsf@eliezer.anholt.net>
Den 29.05.2015 00:38, skrev Eric Anholt:
> Noralf Trønnes <noralf@tronnes.org> writes:
>
>> Den 28.05.2015 20:33, skrev Eric Anholt:
>>> This gives us a function for making mailbox property channel requests
>>> of the firmware, which is most notable in that it will let us get and
>>> set clock rates.
>>>
>>> Signed-off-by: Eric Anholt <eric@anholt.net>
>> ...
>>> +static int rpi_firmware_probe(struct platform_device *pdev)
>>> +{
>>> + struct device *dev = &pdev->dev;
>>> + struct rpi_firmware *fw;
>>> +
>>> + fw = devm_kzalloc(dev, sizeof(*fw), GFP_KERNEL);
>>> + if (!fw)
>>> + return -ENOMEM;
>>> +
>>> + fw->cl.dev = dev;
>>> + fw->cl.rx_callback = response_callback;
>>> + fw->cl.tx_block = true;
>>> +
>>> + fw->chan = mbox_request_channel(&fw->cl, 0);
>>> + if (IS_ERR(fw->chan)) {
>>> + int ret = PTR_ERR(fw->chan);
>>> + if (ret != -EPROBE_DEFER)
>>> + dev_err(dev, "Failed to get mbox channel: %d\n", ret);
>>> + return ret;
>>> + }
>>> +
>>> + init_completion(&fw->c);
>>> +
>>> + platform_set_drvdata(pdev, fw);
>>> +
>>> + rpi_firmware_print_firmware_revision(dev);
>>> +
>>> + return 0;
>>> +}
>>> +
>>> +static int rpi_firmware_remove(struct platform_device *pdev)
>>> +{
>>> + struct rpi_firmware *fw = platform_get_drvdata(pdev);
>>> +
>>> + mbox_free_channel(fw->chan);
>> I guess driver data has to be reset here:
>> platform_set_drvdata(pdev, NULL);
> Fixed.
>
I was wrong about this one as Stephen pointed out.
My point became mute now that rpi_firmware_property_list() doesn't look
up driver data anymore.
next prev parent reply other threads:[~2015-05-28 22:43 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 19:00 RPi firmware driver v2 Eric Anholt
2015-05-13 19:00 ` Eric Anholt
2015-05-13 19:00 ` [PATCH 1/3 v2] dt/bindings: Add binding for the Raspberry Pi firmware driver Eric Anholt
2015-05-13 19:00 ` Eric Anholt
2015-05-14 8:40 ` Lee Jones
2015-05-14 8:40 ` Lee Jones
2015-05-14 8:40 ` Lee Jones
2015-05-14 9:57 ` Eric Anholt
2015-05-14 9:57 ` Eric Anholt
2015-05-14 9:57 ` Eric Anholt
2015-05-17 17:11 ` Noralf Trønnes
2015-05-17 17:11 ` Noralf Trønnes
2015-05-18 17:59 ` [PATCH 1/3 v3] " Eric Anholt
2015-05-18 17:59 ` Eric Anholt
2015-05-28 21:12 ` Stephen Warren
2015-05-28 21:12 ` Stephen Warren
2015-05-28 21:12 ` Stephen Warren
2015-05-13 19:00 ` [PATCH 2/3 v2] ARM: bcm2835: Add " Eric Anholt
2015-05-13 19:00 ` Eric Anholt
2015-05-13 19:00 ` Eric Anholt
2015-05-17 17:30 ` Noralf Trønnes
2015-05-17 17:30 ` Noralf Trønnes
2015-05-17 18:26 ` Noralf Trønnes
2015-05-17 18:26 ` Noralf Trønnes
2015-05-17 18:26 ` Noralf Trønnes
2015-05-18 17:34 ` Eric Anholt
2015-05-18 17:34 ` Eric Anholt
2015-05-18 18:00 ` [PATCH 2/3 v3] " Eric Anholt
2015-05-18 18:00 ` Eric Anholt
[not found] ` <20150528112610.GO11677@x1>
2015-05-28 11:45 ` [PATCH 2/3 v2] " Lee Jones
2015-05-28 11:45 ` Lee Jones
2015-05-28 11:45 ` Lee Jones
2015-05-28 18:33 ` [PATCH 2/3 v4] " Eric Anholt
2015-05-28 18:33 ` Eric Anholt
2015-05-28 18:33 ` Eric Anholt
2015-05-28 21:28 ` Stephen Warren
2015-05-28 21:28 ` Stephen Warren
2015-05-28 21:39 ` Noralf Trønnes
2015-05-28 21:39 ` Noralf Trønnes
2015-05-28 21:39 ` Noralf Trønnes
2015-05-28 22:09 ` Stephen Warren
2015-05-28 22:09 ` Stephen Warren
2015-05-28 22:09 ` Stephen Warren
2015-05-28 22:36 ` Eric Anholt
2015-05-28 22:36 ` Eric Anholt
2015-05-28 21:42 ` Noralf Trønnes
2015-05-28 21:42 ` Noralf Trønnes
2015-05-28 22:10 ` Stephen Warren
2015-05-28 22:10 ` Stephen Warren
2015-05-28 22:10 ` Stephen Warren
2015-05-28 22:38 ` Eric Anholt
2015-05-28 22:38 ` Eric Anholt
2015-05-28 22:38 ` Eric Anholt
2015-05-28 22:43 ` Noralf Trønnes [this message]
2015-05-28 22:43 ` Noralf Trønnes
2015-05-28 22:43 ` Noralf Trønnes
2015-05-28 21:17 ` [PATCH 2/3 v2] " Stephen Warren
2015-05-28 21:17 ` Stephen Warren
2015-05-28 21:17 ` Stephen Warren
2015-05-28 22:40 ` Noralf Trønnes
2015-05-28 22:40 ` Noralf Trønnes
2015-05-28 22:40 ` Noralf Trønnes
2015-05-13 19:00 ` [PATCH 3/3 v2] ARM: bcm2835: Add the firmware driver information to the RPi DT Eric Anholt
2015-05-13 19:00 ` Eric Anholt
2015-05-28 21:29 ` Stephen Warren
2015-05-28 21:29 ` Stephen Warren
2015-05-28 21:29 ` Stephen Warren
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=55679A22.2090909@tronnes.org \
--to=noralf@tronnes.org \
--cc=linux-arm-kernel@lists.infradead.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.