Using P9_41 as an input using 4.1 kernel.

Hi.

I have the following DTO that I’ve been using successfully in kernel 3.8 to use pin P9_41 as an input:

`

P9_41A_i: P9_41A_in{pinctrl-single,pins = <0x1B4 0x37>;};
P9_41A_o: P9_41A_out{pinctrl-single,pins = <0x1B4 0x0F 0x1A8 0x37>;};

P9_41A_mux {
compatible = “bone-pinmux-helper”;
status = “okay”;
pinctrl-names = “input”, “output”;
pinctrl-0 = <&P9_41A_i>;
pinctrl-1 = <&P9_41A_o>;
};

`

After compiling and loading the DTO in kernel 3.8, the /sys/devices/ocp.4/P9_41_mux/status file is created and if I echo “input” into it, I can read the pin as an input. However, in kernel 4.1, the /sys/devices/platform/ocp/P9_41_mux/status file is created but when I echo “input” to it, nothing happens and I can’t read the value of the pin.

What am I missing? What else do I need to use to enable P9_42 as an input?

Thanks!

P9_41 is used by audio, so make sure you are using the
*-nhdmi-overlay.dtb, *-emmc-overlay.dtb or *-overlay.dtb

Regards,

ah p9_41.. so on mainline it's setup as clkout2_pin:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/am335x-bone-common.dtsi#n98

I left it enabled for our 4.1.x branch:

https://github.com/beagleboard/linux/blob/4.1/arch/arm/boot/dts/am335x-bone-common.dtsi#L98-L102

It was first introduced here:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/am335x-bone-common.dtsi?id=2ba3549352277514a8e4790adff77a783ee1b9e2

anyone have a hint/reason why it should/shouldn't be enabled by default..

Regards,

P9_41 is used by audio, so make sure you are using the
*-nhdmi-overlay.dtb, *-emmc-overlay.dtb or *-overlay.dtb

I have dtb=am335x-boneblack-emmc-overlay.dtb in /boot/uEnv.txt so it should be fine (?)

ah p9_41… so on mainline it’s setup as clkout2_pin:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/am335x-bone-common.dtsi#n98

I left it enabled for our 4.1.x branch:

https://github.com/beagleboard/linux/blob/4.1/arch/arm/boot/dts/am335x-bone-common.dtsi#L98-L102

It was first introduced here:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/am335x-bone-common.dtsi?id=2ba3549352277514a8e4790adff77a783ee1b9e2

anyone have a hint/reason why it should/shouldn’t be enabled by default…

I’m affraid I don’t understand this… Does this mean that the pin is used for something else and I can’t use it as GPIO? Or that I should disable something else before using it as GPIO?

Thanks for the replies!

Looking at the datasheet, it's only tied to the EMU3 on the
un-populated jtag connector..

It's also shared with GPIO3_20 mcaspo_axr1...

I think i've seen enough, and i'm just going to remove the default
clock2 setting and re-enable P9_41 in the overlays..

Regards,

I think i’ve seen enough, and i’m just going to remove the default
clock2 setting and re-enable P9_41 in the overlays…

That’s great, thanks!

How would I disable the default overlays that you linked?

How soon would your changes reach the repos as a new version of the kernel (no pressure, just curiosity) ?

I think i've seen enough, and i'm just going to remove the default
clock2 setting and re-enable P9_41 in the overlays..

Yeah, it's tied to audio:

http://lists.infradead.org/pipermail/linux-arm-kernel/2013-May/166996.html

That's great, thanks!

How would I disable the default overlays that you linked?

How soon would your changes reach the repos as a new version of the kernel
(no pressure, just curiosity) ?

Right now you can use the dtb-rebuilder to first rebuild the *.dtb
with it removed, then rebuild the bb.org-overlays with it p9_41
un-commented out..

Regards,