Help with bindings for usb251x chips

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Hi folks,

I'm writing a driver for the usb2514 USB hub chip. It supports a small feature set, mostly:

* Up to 7 ports, with any individual ports disabled
* Ports can be marked as hardwired
* Device may appear as a composite device
* per-port O/C GPIO outputs.

My initial though was to copy the 3503 driver, which is similar, but the fact that ports can be arbitrarily disabled makes me think that a better approach is needed.

Is there a way to specify USB ports in device-tree, similar to how hdmi ports are?

Rather than something messy like this:

        usb2514@2c {
                compatible = "smsc,usb2514";
                reg = <0x2c>;
                disabled-ports = <3>;
                overcurrent-gpios = <&gpio4 19 0>;   # Which port does this belong to?
                non-removable-ports = <1>;
                reset-gpio = <&gpio4 20 0>;
        };

I'd prefer to have something like:

        usb2514@2c {
                compatible = "smsc,usb2514";
                reset-gpio = <&gpio4 20 0>;
                reg = <0x2c>;
		usb-port@0 {
			# No O/C sensing
			hardwired;
			status = "okay";
		};
		usb-port@1 {
			overcurrent-gpio = <&gpio4 19 1>;
			status = "okay";
		};
		usb-port@2 {
			status = "disabled";
		};
		usb-port@3 {
			# No O/C sensing
			status = "okay";
		};
        };

Or would something like:


        usb2514@2c {
                compatible = "smsc,usb2514";
                reset-gpio = <&gpio4 20 0>;
                reg = <0x2c>;
		usb-port@0 {
			# No O/C sensing
			hard-port-no = <0>;
			hardwired;
			status = "okay";
		};
		usb-port@1 {
			hard-port-no = <1>;
			overcurrent-gpio = <&gpio4 19 1>;
			status = "okay";
		};
		usb-port@2 {
			hard-port-no = <3>;
			# No O/C sensing
			status = "okay";
		};
        };

Be better?

Whats the best way to handle this?

-Ian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux