* Point-to-point bus in device tree @ 2012-04-05 18:15 David Brown 2012-04-05 19:23 ` Stephen Warren 0 siblings, 1 reply; 5+ messages in thread From: David Brown @ 2012-04-05 18:15 UTC (permalink / raw) To: devicetree-discuss; +Cc: linux-arm-msm, linux-kernel, linux-arm-kernel Some MSM SoCs have a small serial-type "bus" that is used to communicate with the PMIC devices. This interface is always point-to-point. I'm doing a device-tree conversion of the driver that Ken Heitke posted last year <https://lkml.org/lkml/2011/2/17/503>. A naive conversion to device tree, would result in something like this: qcom,ssbi@500000 { compatible = "qcom,ssbi"; reg = <0x500000 0x1000>; qcom,controller-type = "ssbi"; qcom,pmic8058@0 { reg = <0x0 0x01>; ... } } There would end up being an extraneous register for the device on the other end (there are no addresses), and there would need to be code in the ssbi driver to traverse this small tree to find these nodes. Another approach would be to make the pmic driver the actual device, and just have it use the ssbi code as a library. Something like: qcom,pmic8058@500000 { compatible = "qcom,pmic8058"; reg = <0x500000 0x1000>; qcom,ssbi-type = "ssbi"; ... } This is a lot cleaner, takes less code, but doesn't technically represent how the hardware is really structured. Does anyone have strong (or weak) feelings about this? Thanks, David -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Point-to-point bus in device tree 2012-04-05 18:15 Point-to-point bus in device tree David Brown @ 2012-04-05 19:23 ` Stephen Warren [not found] ` <4F7DF142.5050601-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Stephen Warren @ 2012-04-05 19:23 UTC (permalink / raw) To: David Brown Cc: devicetree-discuss, linux-arm-msm, linux-kernel, linux-arm-kernel On 04/05/2012 12:15 PM, David Brown wrote: > Some MSM SoCs have a small serial-type "bus" that is used to > communicate with the PMIC devices. This interface is always > point-to-point. I'm doing a device-tree conversion of the driver that > Ken Heitke posted last year <https://lkml.org/lkml/2011/2/17/503>. > > A naive conversion to device tree, would result in something like > this: > > qcom,ssbi@500000 { > compatible = "qcom,ssbi"; > reg = <0x500000 0x1000>; > qcom,controller-type = "ssbi"; > > qcom,pmic8058@0 { > reg = <0x0 0x01>; > ... > } > } > > There would end up being an extraneous register for the device on the > other end (there are no addresses), and there would need to be code in > the ssbi driver to traverse this small tree to find these nodes. Isn't that extra code simply: of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); That seems like pretty low overhead. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <4F7DF142.5050601-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>]
* Re: Point-to-point bus in device tree [not found] ` <4F7DF142.5050601-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> @ 2012-04-05 20:08 ` David Brown 2012-04-06 15:16 ` David Brown 0 siblings, 1 reply; 5+ messages in thread From: David Brown @ 2012-04-05 20:08 UTC (permalink / raw) To: Stephen Warren Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Thu, Apr 05, 2012 at 01:23:46PM -0600, Stephen Warren wrote: > On 04/05/2012 12:15 PM, David Brown wrote: > > Some MSM SoCs have a small serial-type "bus" that is used to > > communicate with the PMIC devices. This interface is always > > point-to-point. I'm doing a device-tree conversion of the driver that > > Ken Heitke posted last year <https://lkml.org/lkml/2011/2/17/503>. > > > > A naive conversion to device tree, would result in something like > > this: > > > > qcom,ssbi@500000 { > > compatible = "qcom,ssbi"; > > reg = <0x500000 0x1000>; > > qcom,controller-type = "ssbi"; > > > > qcom,pmic8058@0 { > > reg = <0x0 0x01>; > > ... > > } > > } > > > > There would end up being an extraneous register for the device on the > > other end (there are no addresses), and there would need to be code in > > the ssbi driver to traverse this small tree to find these nodes. > > Isn't that extra code simply: > > of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); > > That seems like pretty low overhead. True, but it still bothers me to have to have a bogus register. David -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Point-to-point bus in device tree 2012-04-05 20:08 ` David Brown @ 2012-04-06 15:16 ` David Brown 2012-04-07 1:27 ` Grant Likely 0 siblings, 1 reply; 5+ messages in thread From: David Brown @ 2012-04-06 15:16 UTC (permalink / raw) To: Stephen Warren Cc: devicetree-discuss, linux-arm-msm, linux-kernel, linux-arm-kernel On Thu, Apr 05, 2012 at 01:08:29PM -0700, David Brown wrote: > On Thu, Apr 05, 2012 at 01:23:46PM -0600, Stephen Warren wrote: > > On 04/05/2012 12:15 PM, David Brown wrote: > > > Some MSM SoCs have a small serial-type "bus" that is used to > > > communicate with the PMIC devices. This interface is always > > > point-to-point. I'm doing a device-tree conversion of the driver that > > > Ken Heitke posted last year <https://lkml.org/lkml/2011/2/17/503>. > > > > > > A naive conversion to device tree, would result in something like > > > this: > > > > > > qcom,ssbi@500000 { > > > compatible = "qcom,ssbi"; > > > reg = <0x500000 0x1000>; > > > qcom,controller-type = "ssbi"; > > > > > > qcom,pmic8058@0 { > > > reg = <0x0 0x01>; > > > ... > > > } > > > } > > > > > > There would end up being an extraneous register for the device on the > > > other end (there are no addresses), and there would need to be code in > > > the ssbi driver to traverse this small tree to find these nodes. > > > > Isn't that extra code simply: > > > > of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); > > > > That seems like pretty low overhead. > > True, but it still bothers me to have to have a bogus register. Ok, not sure where I got that idea, but I don't appear to actually need a register in the pmic8058 node for of_platform_populate to create a platform device. It only needs a compatible field. So, it look like that matches just what I need. Thanks, David -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Point-to-point bus in device tree 2012-04-06 15:16 ` David Brown @ 2012-04-07 1:27 ` Grant Likely 0 siblings, 0 replies; 5+ messages in thread From: Grant Likely @ 2012-04-07 1:27 UTC (permalink / raw) To: David Brown, Stephen Warren Cc: devicetree-discuss, linux-arm-msm, linux-kernel, linux-arm-kernel On Fri, 6 Apr 2012 08:16:10 -0700, David Brown <davidb@codeaurora.org> wrote: > On Thu, Apr 05, 2012 at 01:08:29PM -0700, David Brown wrote: > > On Thu, Apr 05, 2012 at 01:23:46PM -0600, Stephen Warren wrote: > > > On 04/05/2012 12:15 PM, David Brown wrote: > > > > Some MSM SoCs have a small serial-type "bus" that is used to > > > > communicate with the PMIC devices. This interface is always > > > > point-to-point. I'm doing a device-tree conversion of the driver that > > > > Ken Heitke posted last year <https://lkml.org/lkml/2011/2/17/503>. > > > > > > > > A naive conversion to device tree, would result in something like > > > > this: > > > > > > > > qcom,ssbi@500000 { > > > > compatible = "qcom,ssbi"; > > > > reg = <0x500000 0x1000>; > > > > qcom,controller-type = "ssbi"; > > > > > > > > qcom,pmic8058@0 { > > > > reg = <0x0 0x01>; > > > > ... > > > > } > > > > } > > > > > > > > There would end up being an extraneous register for the device on the > > > > other end (there are no addresses), and there would need to be code in > > > > the ssbi driver to traverse this small tree to find these nodes. > > > > > > Isn't that extra code simply: > > > > > > of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); > > > > > > That seems like pretty low overhead. > > > > True, but it still bothers me to have to have a bogus register. > > Ok, not sure where I got that idea, but I don't appear to actually > need a register in the pmic8058 node for of_platform_populate to > create a platform device. It only needs a compatible field. So, it > look like that matches just what I need. Correct. Don't use a reg and all will look good. g. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-04-07 1:27 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-04-05 18:15 Point-to-point bus in device tree David Brown 2012-04-05 19:23 ` Stephen Warren [not found] ` <4F7DF142.5050601-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> 2012-04-05 20:08 ` David Brown 2012-04-06 15:16 ` David Brown 2012-04-07 1:27 ` Grant Likely
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).