Skip to contentSkip to conversation

Point-to-point bus in device tree

DISCUSSION David Brown 3 participants 5 messages Apr 5, 2012 – Apr 7, 2012 Arm Qualcomm mailing list

lore
Share & tools
lore
#0 lore raw

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 at 500000 {
		compatible = "qcom,ssbi";
		reg = <0x500000 0x1000>;
		qcom,controller-type = "ssbi";

		qcom,pmic8058 at 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 at 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

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#1 lore raw
Quoted 19 lines · David Brown

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 at 500000 {
		compatible = "qcom,ssbi";
		reg = <0x500000 0x1000>;
		qcom,controller-type = "ssbi";

		qcom,pmic8058 at 0 {
			reg = <0x0 0x01>;
			...
		}
	}
Quoted 3 lines

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.

#2 lore raw
Quoted 24 lines · Stephen Warren
Quoted 19 lines · David Brown

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 at 500000 {
		compatible = "qcom,ssbi";
		reg = <0x500000 0x1000>;
		qcom,controller-type = "ssbi";

		qcom,pmic8058 at 0 {
			reg = <0x0 0x01>;
			...
		}
	}
Quoted 3 lines

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.

Quoted 5 lines

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

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#3 lore raw
Quoted 25 lines · David Brown
Quoted 24 lines · Stephen Warren
Quoted 22 lines · David Brown

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 at 500000 {
		compatible = "qcom,ssbi";
		reg = <0x500000 0x1000>;
		qcom,controller-type = "ssbi";

		qcom,pmic8058 at 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.

Quoted 7 lines
Quoted 5 lines

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

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#4 lore raw
Quoted 30 lines · David Brown
Quoted 29 lines · David Brown
Quoted 28 lines · Stephen Warren
Quoted 19 lines · David Brown

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 at 500000 {
		compatible = "qcom,ssbi";
		reg = <0x500000 0x1000>;
		qcom,controller-type = "ssbi";

		qcom,pmic8058 at 0 {
			reg = <0x0 0x01>;
			...
		}
	}
Quoted 3 lines

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);

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

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.