Linux API/linux2026. 4. 6. 16:14

hid multitouch 드라이버 보다가 신기한(?)거 발견

간단하게(?)  /sys 경로에 show_mt 라는 파일이 생성되고 boolean 타입으로 내용을 써주면 드라이버에서

그 값을 이용해 작동하게 되는 매크로.

 

module_param(show_mt, bool, 0444);

[링크 : https://github.com/bentiss/hid-multitouch/blob/master/hid-multitouch.c]

 

[링크 :https://reakwon.tistory.com/226]

'Linux API > linux' 카테고리의 다른 글

커널 cmdline 관련 함수  (0) 2026.04.03
kernel input_event()  (1) 2025.12.23
linux 시리얼 포트 열기(termios)  (0) 2025.10.11
LD_DEBUG=libs  (0) 2025.06.02
linux device tree(dtb) 문법...?  (0) 2024.12.04
Posted by 구차니
Linux API/linux2026. 4. 3. 12:06

 

22.5 cmdline_find_option()
command line에서 option을 파싱하는 함수다.

이 함수는 __cmdline_find_option()를 호출한다. booting시의 함수라면 cmdline의 위치가 1M 위쪽에 있으면 찾지않고 리턴한다.

[링크 : https://www.iamroot.org/ldocs/linux.html#sec-22-5]

'Linux API > linux' 카테고리의 다른 글

kernel driver  (0) 2026.04.06
kernel input_event()  (1) 2025.12.23
linux 시리얼 포트 열기(termios)  (0) 2025.10.11
LD_DEBUG=libs  (0) 2025.06.02
linux device tree(dtb) 문법...?  (0) 2024.12.04
Posted by 구차니
Linux API/linux2025. 12. 23. 10:52

먼가 uinput 에서 사용하던 함수 같은 느낌의 코드가 보여서 찾아보는 중

input_event(input, EV_ABS, ABS_MT_POSITION_X, *slot->x);
input_event(input, EV_ABS, ABS_MT_POSITION_Y, *slot->y);
input_event(input, EV_ABS, ABS_MT_TOOL_X, *slot->cx);
input_event(input, EV_ABS, ABS_MT_TOOL_Y, *slot->cy);
input_event(input, EV_ABS, ABS_MT_DISTANCE, !*slot->tip_state);
input_event(input, EV_ABS, ABS_MT_ORIENTATION, orientation);
input_event(input, EV_ABS, ABS_MT_PRESSURE, *slot->p);
input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, major);
input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, minor);

 

void input_event(struct input_dev * dev, unsigned int type, unsigned int code, int value)
report new input event

Parameters

struct input_dev * devdevice that generated the eventunsigned int typetype of the eventunsigned int codeevent codeint valuevalue of the event

Description
This function should be used by drivers implementing various input devices to report input events. See also input_inject_event().

NOTE

input_event() may be safely used right after input device was allocated with input_allocate_device(), even before it is registered with input_register_device(), but the event will not reach any of the input handlers. Such early invocation of input_event() may be used to ‘seed’ initial state of a switch or initial position of absolute axis, etc.

[링크 : https://www.kernel.org/doc/html/v4.14/driver-api/input.html#c.input_event]

'Linux API > linux' 카테고리의 다른 글

kernel driver  (0) 2026.04.06
커널 cmdline 관련 함수  (0) 2026.04.03
linux 시리얼 포트 열기(termios)  (0) 2025.10.11
LD_DEBUG=libs  (0) 2025.06.02
linux device tree(dtb) 문법...?  (0) 2024.12.04
Posted by 구차니
Linux API/network2025. 12. 22. 12:09

'Linux API > network' 카테고리의 다른 글

bind(): Address already in use  (0) 2023.07.21
recv 와 read 차이  (0) 2023.06.23
AF_PACKET로 link layer 열기  (0) 2022.06.09
linux tcp server listen accept connect  (0) 2022.05.11
ssl socket 예제  (0) 2022.03.25
Posted by 구차니
Linux API/linux2025. 10. 11. 21:23

이렇게 상세하게 정리된 건 첨보는 듯.

 

[링크 : https://laboratorium.tistory.com/24]

'Linux API > linux' 카테고리의 다른 글

커널 cmdline 관련 함수  (0) 2026.04.03
kernel input_event()  (1) 2025.12.23
LD_DEBUG=libs  (0) 2025.06.02
linux device tree(dtb) 문법...?  (0) 2024.12.04
usb hid, hidraw  (0) 2024.03.11
Posted by 구차니
Linux API/linux2025. 6. 2. 18:03

리눅스에서 공유 라이브러리(so) 호출시 경로등을 확인하기 용이한 디버깅 변수

 

LD_DEBUG=help cat
Valid options for the LD_DEBUG environment variable are:

  libs        display library search paths
  reloc       display relocation processing
  files       display progress for input file
  symbols     display symbol table processing
  bindings    display information about symbol binding
  versions    display version dependencies
  all         all previous options combined
  statistics  display relocation statistics
  unused      determined unused DSOs
  help        display this help message and exit

To direct the debugging output into a file instead of standard output
a filename can be specified using the LD_DEBUG_OUTPUT environment
variable.

[링크 : https://bnikolic.co.uk/blog/linux-ld-debug.html]

'Linux API > linux' 카테고리의 다른 글

kernel input_event()  (1) 2025.12.23
linux 시리얼 포트 열기(termios)  (0) 2025.10.11
linux device tree(dtb) 문법...?  (0) 2024.12.04
usb hid, hidraw  (0) 2024.03.11
linux 멀티터치 프로토콜  (0) 2024.03.08
Posted by 구차니
Linux API/linux2024. 12. 4. 14:18

고통 받고 있는 ptn5110에 대해서 검색하는데

리눅스 소스상에 dtb로만 존재해서 문법을 찾아보는 중.

봐야할 부분은 source-pdos의 <PDO_FIXED()>; 인데

	ptn5110: tcpc@50 {
		compatible = "nxp,ptn5110", "tcpci";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_typec>;
		reg = <0x50>;
		interrupt-parent = <&lsio_gpio1>;
		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;

		usb_con1: connector {
			compatible = "usb-c-connector";
			label = "USB-C";
			power-role = "source";
			data-role = "dual";
			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;

			ports {
				#address-cells = <1>;
				#size-cells = <0>;

				port@0 {
					reg = <0>;

					typec_dr_sw: endpoint {
						remote-endpoint = <&usb3_drd_sw>;
					};
				};

				port@1 {
					reg = <1>;

					typec_con_ss: endpoint {
						remote-endpoint = <&usb3_data_ss>;
					};
				};
			};
		};
	};

 

<> 는 cell 이라고 부르고

[링크 : https://kernel.bz/boardPost/118684/3]

 

unsigned int로 된 배열인것 같은데

  • 텍스트 문자열 (널로 종료 됨)은 큰 따옴표로 표시됩니다.
    • string-property = "a string";
  • ‘셀’은 꺾쇠 괄호로 구분 된 32 비트 부호없는 정수입니다.
    • cell-property = <0xbeef 123 0xabcd1234>;
  • 이진 데이터는 대괄호로 구분됩니다.
    • binary-property = [0x01 0x23 0x45 0x67];
  • 다른 표현의 데이터는 쉼표를 사용하여 함께 연결할 수 있습니다.
    • mixed-property = "a string", [0x01 0x23 0x45 0x67], <0x12345678>;
  • 쉼표는 문자열 목록을 만드는 데에도 사용됩니다.
    • string-list = "red fish", "blue fish";

[링크 : https://jung-max.github.io/2019/10/22/Device_Tree_문법/]

 

도대체 저 매크로는 어떻게 dtb에서 인식을 하고 쓰는거지? 하고 찾아보니

아래의 경로에서 dt-bindings 라는 곳에서 정의가 되어있었다.

linux-master/scripts/dtc/include-prefixes/dt-bindings/usb

 

선언을 하도 여러군데서 하다보니 일반소스에서만 선언된 줄 알았는데..

#define PDO_FIXED(mv, ma, flags) \
    (PDO_TYPE(PDO_TYPE_FIXED) | (flags) | \
    PDO_FIXED_VOLT(mv) | PDO_FIXED_CURR(ma))

 

device tress binding 이라는 녀석이 또 추가 되었나 보다..

[링크 : https://docs.zephyrproject.org/latest/build/dts/bindings.html]

'Linux API > linux' 카테고리의 다른 글

linux 시리얼 포트 열기(termios)  (0) 2025.10.11
LD_DEBUG=libs  (0) 2025.06.02
usb hid, hidraw  (0) 2024.03.11
linux 멀티터치 프로토콜  (0) 2024.03.08
btrfs CoW  (0) 2024.02.15
Posted by 구차니
Linux API/alsa2024. 6. 4. 19:34

i는 interleave

n은 non:interleave

(i라서 정수인줄..)

[링크 : https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gabc748a500743713eafa960c7d104ca6f]

[링크 : https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gae599772ce3d0aa6a70de143abcf145e7]

 

 

SND_PCM_FORMAT_FLOAT

당연히(?) alsa는 pcm singed short과 같은 정수포맷만 지원할 줄 알았는데, 실수가 있다니 놀랍네

[링크 : https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#ggaa14b7f26877a812acbb39811364177f8a7d9fd83c6ff5be7a9cde4b0673b64bf0]

'Linux API > alsa' 카테고리의 다른 글

alsa 예제  (0) 2024.06.04
alsa 구조  (0) 2015.05.29
alsa timestamp  (0) 2014.11.26
alsa async  (0) 2014.11.26
alsa debug function  (0) 2014.11.18
Posted by 구차니
Linux API/alsa2024. 6. 4. 19:27

'Linux API > alsa' 카테고리의 다른 글

alsa 함수들  (0) 2024.06.04
alsa 구조  (0) 2015.05.29
alsa timestamp  (0) 2014.11.26
alsa async  (0) 2014.11.26
alsa debug function  (0) 2014.11.18
Posted by 구차니
Linux API2024. 5. 15. 00:46

 

alsa - Advanced Linux Sound Architecture

[링크 : https://www.alsa-project.org/wiki/Main_Page]

[링크 : https://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture\]

 

/dev에 붙지 않고 hw:0,0 식으로 식별하고, cat /proc/asound/pcm 으로 장치명(?)을 얻을수 있다고

[링크 : https://bbs.archlinux.org/viewtopic.php?id=99234]

 

OSS - Open Sound System

RTL-SDR 해볼때 사용하던 /dev/dsp 장치

[링크 : https://en.wikipedia.org/wiki/Open_Sound_System]

 

portaudio

[링크 : https://www.portaudio.com/]

[링크 : ]

 

pulseaudio

[링크 : https://en.wikipedia.org/wiki/PulseAudio]

 

pipewire

[링크 : https://en.wikipedia.org/wiki/PipeWire]

 

JACK

[링크 : https://en.wikipedia.org/wiki/JACK_Audio_Connection_Kit]

 

[링크 : https://www.reddit.com/r/linuxaudio/comments/tvirbz/portaudio_vs_pulseaudio_vs_pipewire]

 

+

[링크 : https://askubuntu.com/questions/581128/what-is-the-relation-between-alsa-and-pulseaudio-sound-architecture]

'Linux API' 카테고리의 다른 글

kms - Kernel Mode Setting  (0) 2022.07.14
syslog c api(?)  (0) 2021.02.17
libescp  (0) 2019.01.03
cups api  (0) 2018.12.20
system wait stdout  (0) 2018.10.22
Posted by 구차니