From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Faiz Abbas <faiz_abbas@ti.com>, Dan Murphy <dmurphy@ti.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
netdev@vger.kernel.org, linux-can@vger.kernel.org
Cc: broonie@kernel.org, lgirdwood@gmail.com, catalin.marinas@arm.com,
mark.rutland@arm.com, robh+dt@kernel.org, wg@grandegger.com,
sriram.dash@samsung.com
Subject: Re: [PATCH v2 2/3] can: m_can: m_can_platform: Add support for enabling transceiver
Date: Fri, 21 Feb 2020 09:09:18 +0100 [thread overview]
Message-ID: <8a001afe-dc97-fa1e-4e80-20da89eb2105@pengutronix.de> (raw)
In-Reply-To: <8885c00b-7b73-0448-7e9d-ecb19fe84adf@ti.com>
On 2/21/20 8:54 AM, Faiz Abbas wrote:
> Hi Dan,
>
> On 17/02/20 8:40 pm, Dan Murphy wrote:
>> Faiz
>>
>> On 2/17/20 8:28 AM, Faiz Abbas wrote:
>>> CAN transceivers on some boards have a standby line which can be
>>> toggled to enable/disable the transceiver. Model this as an optional
>>> fixed xceiver regulator.
>>>
>>> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
>>> Acked-by: Sriram Dash <sriram.dash@samsung.com>
>>> ---
>>> drivers/net/can/m_can/m_can_platform.c | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>>
>>> diff --git a/drivers/net/can/m_can/m_can_platform.c
>>> b/drivers/net/can/m_can/m_can_platform.c
>>> index 38ea5e600fb8..719468fab507 100644
>>> --- a/drivers/net/can/m_can/m_can_platform.c
>>> +++ b/drivers/net/can/m_can/m_can_platform.c
>>> @@ -6,6 +6,7 @@
>>> // Copyright (C) 2018-19 Texas Instruments Incorporated -
>>> http://www.ti.com/
>>> #include <linux/platform_device.h>
>>> +#include <linux/regulator/consumer.h>
>>> #include "m_can.h"
>>> @@ -57,6 +58,7 @@ static int m_can_plat_probe(struct platform_device
>>> *pdev)
>>> {
>>> struct m_can_classdev *mcan_class;
>>> struct m_can_plat_priv *priv;
>>> + struct regulator *reg_xceiver;
>>> struct resource *res;
>>> void __iomem *addr;
>>> void __iomem *mram_addr;
>>> @@ -111,6 +113,10 @@ static int m_can_plat_probe(struct
>>> platform_device *pdev)
>>> m_can_init_ram(mcan_class);
>>> + reg_xceiver = devm_regulator_get_optional(&pdev->dev, "xceiver");
>>> + if (PTR_ERR(reg_xceiver) == -EPROBE_DEFER)
>>> + return -EPROBE_DEFER;
>>> +
>>
>> Where is this regulator enabled?
>
> I have set regulator-boot-on flag in the dt so this didn't require an
> enable.
Please don't do this, please handle it properly.
>> Shouldn't the regulator be managed by runtime PM as well?
If so, then make the runtime pm kconfig option mandatory.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2020-02-21 8:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-17 14:28 [PATCH v2 0/3] Add Support for MCAN in AM654x-idk Faiz Abbas
2020-02-17 14:28 ` [PATCH v2 1/3] dt-bindings: m_can: Add Documentation for transceiver regulator Faiz Abbas
2020-02-19 20:35 ` Rob Herring
2020-02-21 8:31 ` Faiz Abbas
2020-02-21 8:31 ` Marc Kleine-Budde
2020-02-26 9:10 ` Faiz Abbas
2020-03-02 8:16 ` Faiz Abbas
2020-03-09 14:30 ` Faiz Abbas
2020-02-17 14:28 ` [PATCH v2 2/3] can: m_can: m_can_platform: Add support for enabling transceiver Faiz Abbas
2020-02-17 15:10 ` Dan Murphy
2020-02-21 7:54 ` Faiz Abbas
2020-02-21 8:09 ` Marc Kleine-Budde [this message]
2020-02-17 14:28 ` [PATCH v2 3/3] arm64: defconfig: Add Support for Bosch M_CAN controllers Faiz Abbas
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=8a001afe-dc97-fa1e-4e80-20da89eb2105@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=dmurphy@ti.com \
--cc=faiz_abbas@ti.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sriram.dash@samsung.com \
--cc=wg@grandegger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox