diff --git a/drivers/power/reset/reboot-mode.h b/include/linux/reboot-mode.hsimilarity index 100%rename from drivers/power/reset/reboot-mode.hrename to include/linux/reboot-mode.h
--
2.12.0
In some Qualcomm platforms the magic for informing LK which mode to
reboot into is stored in the PON_SOFT_RB_SPARE register. Register with
the reboot mode helpers to expose this to the user.
Signed-off-by: Bjorn Andersson <redacted>
---
drivers/input/misc/Kconfig | 1 +
drivers/input/misc/pm8941-pwrkey.c | 28 ++++++++++++++++++++++++++++
2 files changed, 29 insertions(+)
On Fri, May 26, 2017 at 11:51:30PM -0700, Bjorn Andersson wrote:
In some Qualcomm platforms the magic for informing LK which mode to
reboot into is stored in the PON_SOFT_RB_SPARE register. Register with
the reboot mode helpers to expose this to the user.
Hmm, is the power key driver the best place to have this? WHy isn't this
a driver in its own right?
On Mon 29 May 19:53 PDT 2017, Dmitry Torokhov wrote:
On Fri, May 26, 2017 at 11:51:30PM -0700, Bjorn Andersson wrote:
quoted
In some Qualcomm platforms the magic for informing LK which mode to
reboot into is stored in the PON_SOFT_RB_SPARE register. Register with
the reboot mode helpers to expose this to the user.
Hmm, is the power key driver the best place to have this? WHy isn't this
a driver in its own right?
The functionality is part of the "PON" block in the Qualcomm PMICs,
other functionality from this block relates to configuration and
handling related to power-key and reset-key.
Several of these properties are intermingled, so I do believe it's best
to handle them in a single driver; that said, it might no longer be
correct to name the driver "pwrkey" or that it is a "misc input" driver.
Regards,
Bjorn
From: Sebastian Reichel <hidden> Date: 2017-06-08 16:24:15
Hi,
On Fri, May 26, 2017 at 11:51:29PM -0700, Bjorn Andersson wrote:
Move the reboot-mode.h include file into include/linux to allow drivers
outside drivers/power/reset to implement reboot-mode.
Signed-off-by: Bjorn Andersson <redacted>
Thanks, queued. I also created an immutable branch:
git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git ib-psy-reboot-mode-4.13
-- Sebastian
diff --git a/drivers/power/reset/reboot-mode.h b/include/linux/reboot-mode.hsimilarity index 100%rename from drivers/power/reset/reboot-mode.hrename to include/linux/reboot-mode.h
--
2.12.0
From: Sebastian Reichel <hidden> Date: 2017-06-08 16:32:55
Hi,
On Mon, May 29, 2017 at 09:47:11PM -0700, Bjorn Andersson wrote:
On Mon 29 May 19:53 PDT 2017, Dmitry Torokhov wrote:
quoted
On Fri, May 26, 2017 at 11:51:30PM -0700, Bjorn Andersson wrote:
quoted
In some Qualcomm platforms the magic for informing LK which mode to
reboot into is stored in the PON_SOFT_RB_SPARE register. Register with
the reboot mode helpers to expose this to the user.
Hmm, is the power key driver the best place to have this? WHy isn't this
a driver in its own right?
The functionality is part of the "PON" block in the Qualcomm PMICs,
other functionality from this block relates to configuration and
handling related to power-key and reset-key.
Several of these properties are intermingled, so I do believe it's best
to handle them in a single driver; that said, it might no longer be
correct to name the driver "pwrkey" or that it is a "misc input" driver.
I merged patch 1 and provided an immutable branch, so
that this could go through the input subsystem.
To me it doesn't look that intermingled, though. I think
the reboot and reboot-mode parts could go into their own
driver in drivers/power/reset.
-- Sebastian
On Thu 08 Jun 09:32 PDT 2017, Sebastian Reichel wrote:
Hi,
On Mon, May 29, 2017 at 09:47:11PM -0700, Bjorn Andersson wrote:
quoted
On Mon 29 May 19:53 PDT 2017, Dmitry Torokhov wrote:
quoted
On Fri, May 26, 2017 at 11:51:30PM -0700, Bjorn Andersson wrote:
quoted
In some Qualcomm platforms the magic for informing LK which mode to
reboot into is stored in the PON_SOFT_RB_SPARE register. Register with
the reboot mode helpers to expose this to the user.
Hmm, is the power key driver the best place to have this? WHy isn't this
a driver in its own right?
The functionality is part of the "PON" block in the Qualcomm PMICs,
other functionality from this block relates to configuration and
handling related to power-key and reset-key.
Several of these properties are intermingled, so I do believe it's best
to handle them in a single driver; that said, it might no longer be
correct to name the driver "pwrkey" or that it is a "misc input" driver.
I merged patch 1 and provided an immutable branch, so
that this could go through the input subsystem.
Thanks
To me it doesn't look that intermingled, though. I think
the reboot and reboot-mode parts could go into their own
driver in drivers/power/reset.
I did reach out to Rob regarding this and the single hardware block
should be described by a single node in DeviceTree.
As such if we split the non-input related handling into another driver
we would need to make the input driver create a subdevice during probe -
or create a new pon-driver with a new compatible that internally spawns
the pwrkey driver. Neither seems desirable to me...
The features of the PON block not yet shown on LKML are status registers
to indicate the reason for powering up the PMIC and a watchdog (which I
don't believe is used or exposed today).
Regards,
Bjorn
From: Sebastian Reichel <hidden> Date: 2017-06-15 16:27:04
Hi,
On Mon, Jun 12, 2017 at 04:32:03PM -0700, Bjorn Andersson wrote:
On Thu 08 Jun 09:32 PDT 2017, Sebastian Reichel wrote:
quoted
Hi,
On Mon, May 29, 2017 at 09:47:11PM -0700, Bjorn Andersson wrote:
quoted
On Mon 29 May 19:53 PDT 2017, Dmitry Torokhov wrote:
quoted
On Fri, May 26, 2017 at 11:51:30PM -0700, Bjorn Andersson wrote:
quoted
In some Qualcomm platforms the magic for informing LK which mode to
reboot into is stored in the PON_SOFT_RB_SPARE register. Register with
the reboot mode helpers to expose this to the user.
Hmm, is the power key driver the best place to have this? WHy isn't this
a driver in its own right?
The functionality is part of the "PON" block in the Qualcomm PMICs,
other functionality from this block relates to configuration and
handling related to power-key and reset-key.
Several of these properties are intermingled, so I do believe it's best
to handle them in a single driver; that said, it might no longer be
correct to name the driver "pwrkey" or that it is a "misc input" driver.
I merged patch 1 and provided an immutable branch, so
that this could go through the input subsystem.
Thanks
quoted
To me it doesn't look that intermingled, though. I think
the reboot and reboot-mode parts could go into their own
driver in drivers/power/reset.
I did reach out to Rob regarding this and the single hardware block
should be described by a single node in DeviceTree.
As such if we split the non-input related handling into another driver
we would need to make the input driver create a subdevice during probe -
or create a new pon-driver with a new compatible that internally spawns
the pwrkey driver. Neither seems desirable to me...
The pon-driver would have been the proper solution, but with the
binding already being defined that's no longer a nice option :(
The features of the PON block not yet shown on LKML are status registers
to indicate the reason for powering up the PMIC and a watchdog (which I
don't believe is used or exposed today).
So we have a block, which has watchdog, powerdown, reboot, boot-reason,
reboot-mode and power key. To me that does not look like it should be
one driver.
-- Sebastian
On Thu 15 Jun 09:26 PDT 2017, Sebastian Reichel wrote:
Hi,
On Mon, Jun 12, 2017 at 04:32:03PM -0700, Bjorn Andersson wrote:
[..]
quoted
As such if we split the non-input related handling into another driver
we would need to make the input driver create a subdevice during probe -
or create a new pon-driver with a new compatible that internally spawns
the pwrkey driver. Neither seems desirable to me...
The pon-driver would have been the proper solution, but with the
binding already being defined that's no longer a nice option :(
We have a binding for the "qcom,pm8941-pwrkey", but as long as we
maintain the compatibility in the input driver with this we could come
up with a new binding for the "pon" block.
quoted
The features of the PON block not yet shown on LKML are status registers
to indicate the reason for powering up the PMIC and a watchdog (which I
don't believe is used or exposed today).
So we have a block, which has watchdog, powerdown, reboot, boot-reason,
reboot-mode and power key. To me that does not look like it should be
one driver.
Unfortunately I do agree with this.
It would make sense to describe the pon in a single DT-node and have a
pon-driver spawning off individual driver for each functionality. That
way we get a clean representation in DT and we get clean implementation
of each component...
Regards,
Bjorn
From: Rob Herring <robh@kernel.org> Date: 2017-06-15 21:38:59
On Thu, Jun 15, 2017 at 1:33 PM, Bjorn Andersson
[off-list ref] wrote:
On Thu 15 Jun 09:26 PDT 2017, Sebastian Reichel wrote:
quoted
Hi,
On Mon, Jun 12, 2017 at 04:32:03PM -0700, Bjorn Andersson wrote:
[..]
quoted
quoted
As such if we split the non-input related handling into another driver
we would need to make the input driver create a subdevice during probe -
or create a new pon-driver with a new compatible that internally spawns
the pwrkey driver. Neither seems desirable to me...
The pon-driver would have been the proper solution, but with the
binding already being defined that's no longer a nice option :(
We have a binding for the "qcom,pm8941-pwrkey", but as long as we
maintain the compatibility in the input driver with this we could come
up with a new binding for the "pon" block.
Yes. My only objection was having the pon node with child devices
purely because that is how Linux splits the driver.
quoted
quoted
The features of the PON block not yet shown on LKML are status registers
to indicate the reason for powering up the PMIC and a watchdog (which I
don't believe is used or exposed today).
So we have a block, which has watchdog, powerdown, reboot, boot-reason,
reboot-mode and power key. To me that does not look like it should be
one driver.
Unfortunately I do agree with this.
As do I. But that is a separate decision from DT bindings.
It would make sense to describe the pon in a single DT-node and have a
pon-driver spawning off individual driver for each functionality. That
way we get a clean representation in DT and we get clean implementation
of each component...
My objection here is we should not just create child nodes to align
with current Linux driver needs. That said, child nodes do sometimes
make sense. If, for example, the key function was not fixed and you
needed to configure what key function is used, then probably a child
node makes sense. It's always possible to add child nodes later
without breaking compatibility. It's hard to remove them.
Rob
From: Sebastian Reichel <hidden> Date: 2017-06-20 14:27:19
Hi,
On Thu, Jun 15, 2017 at 04:38:34PM -0500, Rob Herring wrote:
On Thu, Jun 15, 2017 at 1:33 PM, Bjorn Andersson
[off-list ref] wrote:
quoted
On Thu 15 Jun 09:26 PDT 2017, Sebastian Reichel wrote:
quoted
Hi,
On Mon, Jun 12, 2017 at 04:32:03PM -0700, Bjorn Andersson wrote:
[..]
quoted
quoted
As such if we split the non-input related handling into another driver
we would need to make the input driver create a subdevice during probe -
or create a new pon-driver with a new compatible that internally spawns
the pwrkey driver. Neither seems desirable to me...
The pon-driver would have been the proper solution, but with the
binding already being defined that's no longer a nice option :(
We have a binding for the "qcom,pm8941-pwrkey", but as long as we
maintain the compatibility in the input driver with this we could come
up with a new binding for the "pon" block.
Yes. My only objection was having the pon node with child devices
purely because that is how Linux splits the driver.
So maybe 'compatible = "qcom,pm8041-pon", "qcom,pm8941-pwrkey";'
with pm8941-pwrkey being marked as deprecated in the binding?
quoted
quoted
quoted
The features of the PON block not yet shown on LKML are status registers
to indicate the reason for powering up the PMIC and a watchdog (which I
don't believe is used or exposed today).
So we have a block, which has watchdog, powerdown, reboot, boot-reason,
reboot-mode and power key. To me that does not look like it should be
one driver.
Unfortunately I do agree with this.
As do I. But that is a separate decision from DT bindings.
not much of a discussion if everyone agrees? :)
quoted
It would make sense to describe the pon in a single DT-node and have a
pon-driver spawning off individual driver for each functionality. That
way we get a clean representation in DT and we get clean implementation
of each component...
My objection here is we should not just create child nodes to align
with current Linux driver needs.
Ack.
That said, child nodes do sometimes make sense. If, for example,
the key function was not fixed and you needed to configure what
key function is used, then probably a child node makes sense.
Ack.
It's always possible to add child nodes later without breaking
compatibility. It's hard to remove them.
I don't think so. Adding a child node means, that we want to do
something based on the existance of this child node. So something,
that worked without the child node before no longer works
afterwards.
OTOH removing a child node means, that the child node is not needed
and stuff will work without it => system still works.
-- Sebastian