This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] Linux/AM3352:将 PMIC 电源按钮暴露在用户空间中

Guru**** 2589300 points
Other Parts Discussed in Thread: TPS65217

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/641645/linux-am3352-exposing-pmic-power-button-to-userspace

器件型号:AM3352
主题中讨论的其他器件:TPS65217

工具/软件:Linux

你(们)好

我正在基于 Beagle Bone Black 的定制板上运行。

我已升级到最新的 SDK (4.1.0.6) 、并正在尝试使用 tps65217电源按钮  

我根据文档输入了一个器件节点:

&TPS{
tps65217-pwrbutton{
compatible ="ti、tps65217-pwrbutton";
interrupts =<2>;
};
}; 

似乎创建了几个节点:

/sys/devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton
/sys/firmware/devicetree/base/ocp/i2c@44e0b000/TPS@24/tps65217-pwrbutton
/sys/bus/platform/devices/tps65217-pwrbutton 

但/proc/interrupts 中没有提到任何内容

root@elle-board:~# cat /proc/interrupts
CPU0
16:115418 INTC 68 Level gp_timer
20:563 INTC 12 Level 49000000.EDMA_ccint
22:0 INTC 14 Level 49000000.EDMA_cerrint
26:0 INTC 96 Level 44e07000。GPIO
59:44 INTC 98 Level 4804c000.76.7617
旋转边缘
编码器:4480 c76.768-14:GPIO 16旋转边缘编码器480-7618:480-7680
16 4804c000.GPIO 18 Edge button0
92:0 intc 32 level 481ac000.gpio
125:0 intc 62 level 481ae000.gpio
140:0 481ae000.gpio 14 Edge 48060000.mmc cd
158:2969 intc 72 level 44e09000.serial
162:206 intc 70 level 44e0b000.i163
:0 inc
64 level
165: 0 inc 64 level 480c 71 11 INTC 28 Level mmc1
176:207506 INTC 36 Level tilcdc
182:1974 INTC 18 Level musb-hdrc.0
183:1779 INTC 17 level 47400000。dma-controller
Err:0 

/dev/input 中也没有创建事件节点

我还尝试将 i2c 定义中的节点定义为:

&i2c0{
status ="确定";
时钟频率=<400000>;

TPS:TPS@24{
reg =<0x24>;
status="确定";

背光{
status="确定";
isEL =<2>;// 1 - isET1、2 isET2 */
fdim =<100>;// twr65217_BL =



默认

值;按钮= 100pwrmT;/pwrmT = 50 pwrbt;/pwrmT = 50 pwrbt;/b<b<brightsb</b</b</b>
中断=<2>;
};
};
}; 

这没什么区别

我认为我遗漏了一些明显的东西;任何线索都将被感激地接受。

感谢你的帮助。
此致、
Richard

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    软件团队已收到通知。 他们将在这里作出回应。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好 Richard、

    我认为您的 DTS 条目是正确的、足够了、它与以下 txt 文件保持一致:

    www.kernel.org/.../tps65218-pwrbutton.txt

    在 DTS 中添加该条目之前以及之后、您能否共享/proc/interrupts 中的内容? 请注意、该中断是 NMI。

    您还可以调试以下两个文件、检查电源按钮中断是否初始化并正确启用:

    linux-kernel/drivers/input/misc/tps65218-pwrbutton.c
    linux-kernel/drivers/mfp/tps65217.c

    此致、
    帕维尔
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    你好,Pavel

    我忽略了在内核配置中添加必要的驱动程序
    我最初以为 TPS65217驱动器本身增加了功能、而不是新的驱动器
    -在 menuconfig 中找到正确的驱动程序后,我发现/proc/interrupts 中列出了该驱动程序,并且有一个/dev/input/eventX 节点

    我注意到、它已输入为/dev/input/event0以移动我之前的节点
    -是否有办法确定哪个事件节点(没有"by-id"目录)

    感谢你的帮助

    祝你一切顺利、
    Richard
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Richard、

    [引用 user="Richard McAleer"-是否有方法可以确定哪个事件节点(没有"by-id"目录)

    您可以通过"By-path"目录和/或/proc/bus/input/devices 进行确定、请参阅下面我在 AM335x 入门套件上提供的示例:

    root@AM335x-EVM:/dev/input ls -al
    drwxr-xr-x 3   root              用户160 Mar 2920:53。
    drwxr-xr-x  12 root    13300        Mar 29 20:53 ..
    drwxr-xr-x   2 root               80 Mar 29 20:53 by-path
    crw-rw--   1根    输入     13, 64 Mar 29 20:53 event0
    crw-rw--   1根    输入     13, 65 Mar 29 20:53 EVENT1
    crw-rw--   1根    输入     13, 63 Mar 29 20:53鼠标
    crw-rw--   1根    输入     13, 32 Mar 29 20:53 mouse0
    lrwxrwxrwx   1 root    root 6            Mar 29 20:53 touchscreen0 -> EVENT1
    root@AM335x-EVM:/dev/input # cd by path/
    root@AM335x-EVM:/dev/input/by-path ls -al
    drwxr-xr-x   2 root               80 Mar 2920:53。
    drwxr-xr-x 3   root              160 Mar 29 20:53 ..
    lrwxrwxrwx   1 root    root 3            月9日29日20:53 platform-TI-AM335x-TSC-event ->../EVENT1
    lrwxrwxrwx   1 root    root 3            月9日29日20:53 platform-gpio_buttons@0-event ->../event0
    root@AM335x-EVM:/dev/input/by-path cat /proc/bus/input/devices
    I:BUS=0019 Vendor=0001 Product=0001 Version=0100
    N:name="GPIO_buttons@0"
    P:phys=GPIO-keys/input0
    S:sysfs=/devices/platform/gpio_buttons@0/input/input0
    U:UNIQ =
    H:处理程序=event0
    B:prop=0
    B:ev=3
    B:key=f 0 0 0 0 0 0 0 0 0

    I:bus=0000 Vendor=0000 Product=0000 Version=0000
    N:name="ti-tsc"
    P:phys=
    S:sysfs=/devices/platform/ocp/44e0d000.tscadc/TI-am335x-tsc/input/input1
    U:UNIQ =
    H:处理程序=mouse0 EVENT1
    B:prop=0
    B:ev=b
    B:key=400 0 0 0 0 0 0 0 0 0 0 0
    B:abs=1000003


    此致、
    帕维尔