use uart driver from linux kernel -


there external device (sensor keyboard) connected processor thrue uart port (tx rx) , gpio interrupt line. need write driver keyboard (not standart own protocol, linux kernel 4.1).

i writed module whith line discipline , requested irq on open() function (when open user space /dev/ttymxc3). it's work, line discipline structure has no released callbacks suspend , resume functions.

it's need release sleep keyboard when system sleeping.

i try write tty driver use uart driver, don't know how. how communicate kernel module external devices thrue uart port?

thanks.

you can use uart device in kernel space

    // call userspace     {             mm_segment_t fs;             fs=get_fs();             set_fs(get_ds());//kernel ds             handle = sys_open(uts_uart_dev_name, o_rdwr | o_noctty | o_nonblock, 0);             if( handle < 0 )             {                     printk(kern_info "uts port open fail [%s] \n ", uts_uart_dev_name);                     return -1;             }              set_fs(fs);     }     // call userspace 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -