Hi,
I’m trying to configure the 1-wire driver on the TX1 so I can use the ds18b20 temp sensor on gpio63. I referenced linux/Documentation//devicetree/bindings/w1/w1-gpio.txt which states that the only two required properties for the device tree are compatible and gpios. I have added the following to my device tree:
onewire@0 {
compatible = "w1-gpio";
gpios = <0x78 0x3F 0>;
};
I have connected the ds18b20 data line to GPIO63 through a 4.7k pullup, power to 3.3V and gnd to gnd. I’ve also rebuilt the kernel with 1-wire support. When I try to load the w1-gpio and w1-therm modules I see the following messages:
[ 1727.628517] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:97
[ 1727.636854] in_atomic(): 0, irqs_disabled(): 128, pid: 341, name: w1_bus_master1
[ 1727.644234] CPU: 3 PID: 341 Comm: w1_bus_master1 Not tainted 4.4.38-tegra #1
[ 1727.651178] Hardware name: jetson_tx1 (DT)
[ 1727.655262] Call trace:
[ 1727.657705] [<ffffffc000088ab8>] dump_backtrace+0x0/0xe8
[ 1727.663004] [<ffffffc000088bb4>] show_stack+0x14/0x20
[ 1727.668042] [<ffffffc0003895e0>] dump_stack+0xb4/0xec
[ 1727.673082] [<ffffffc0000c84dc>] ___might_sleep+0x13c/0x148
[ 1727.678641] [<ffffffc0000c8558>] __might_sleep+0x70/0x98
[ 1727.683941] [<ffffffc000b69cec>] mutex_lock+0x24/0x60
[ 1727.688981] [<ffffffc0003bb144>] pinctrl_get_device_gpio_range+0x34/0xf8
[ 1727.695667] [<ffffffc0003bb4b8>] pinctrl_gpio_direction+0x20/0x88
[ 1727.701745] [<ffffffc0003bb548>] pinctrl_gpio_direction_output+0x10/0x18
[ 1727.708432] [<ffffffc0003d9efc>] tegra_gpio_direction_output+0x7c/0xb8
[ 1727.714943] [<ffffffc0003d295c>] _gpiod_direction_output_raw+0xfc/0x2f0
[ 1727.721542] [<ffffffc0003d2b8c>] gpiod_direction_output_raw+0x3c/0x48
[ 1727.727970] [<ffffffbffc019134>] w1_gpio_write_bit_dir+0x2c/0x38 [w1_gpio]
[ 1727.734835] [<ffffffbffc00b7ac>] w1_touch_bit+0x54/0xc8 [wire]
[ 1727.740659] [<ffffffbffc00ba98>] w1_write_8+0xa0/0xd8 [wire]
[ 1727.746309] [<ffffffbffc00a710>] w1_search+0x100/0x288 [wire]
[ 1727.752045] [<ffffffbffc00bd5c>] w1_search_devices+0x44/0x50 [wire]
[ 1727.758303] [<ffffffbffc00a8ec>] w1_search_process_cb+0x54/0x140 [wire]
[ 1727.764907] [<ffffffbffc00aaec>] w1_process+0x8c/0x198 [wire]
[ 1727.770641] [<ffffffc0000c1100>] kthread+0xf8/0x100
[ 1727.775505] [<ffffffc0000847a0>] ret_from_fork+0x10/0x30
Any help would really be appreciated. Thank you!