Device driver of Linux kernel Vs Android kernel

787 views
Skip to first unread message

Chirag Shah

unread,
Apr 26, 2012, 11:38:39 AM4/26/12
to Android Linux Kernel Development
Hi All,
I know that linux mainframe kernel and Android linux kernel are
different (i.e. Binder, Ashmem, pmem, power management etc features
are added). These changes are towards generic architecture and
performance improvement.

But, I want to know in respect to device driver development for new
driver.
(1) If i have plain linux kernel having developmed new device driver,
will the same device driver work with Android without any changes ?
(2) Which changes i need to make to make it compatible with Android ?

- Chirag Shah

Manjeet Pawar

unread,
Apr 26, 2012, 11:43:10 AM4/26/12
to android...@googlegroups.com
I think it will nt work...some how driver gets change from normal linux kernel to android kernel...android on handset is nothing but a "embedded linux"..which are mainly designed with low memory and less resources...

Chirag Shah

unread,
Apr 26, 2012, 5:57:29 PM4/26/12
to Android Linux Kernel Development
Any idea !!!
Which kind of changes i need to make to make it work with Android?
Where can i look for this perticular modifications ?

mark gross

unread,
Apr 26, 2012, 7:38:39 PM4/26/12
to android...@googlegroups.com
There are no changes you really should need to make between an "gnu/linux" and "android/linux" driver.  Some will say you need to add wake_lock's to your driver critical sections but, almost every time I see a wake_lock in the kernel (for the devices I work on) the lock was truly not needed.  The few we needed to keep where associated mostly with charging or some platform level operation (FW update).  One or two are needed for true wake source devices.  Otherwise you don't need any.

Others my have a different opinion on how to use wake locks in kernel.  But, my recomendation is that you don't add them until you have a testable failure case that clearly calls for one.  Don't protectively add them.  They are not like spin locks or mutexes.

just write you linux drivers and start testing your target.  You will end up with lots and lots of tweaks over time depending on how extensive your testing is.  At least that has been my observation.

good luck

--mark




--
create interesting things.

Durgadoss Ramanathan

unread,
Apr 27, 2012, 12:26:16 AM4/27/12
to android...@googlegroups.com
Yeah I agree with Mark. Also, it depends on what kind of drivers you want to write .
I write some sensor drivers..For that, as long as the driver follows standard Linux interfaces (on which android relies on)
it should work on an android device (of course, with HW support for that sensor)

So, I would again re-iterate that it depends on _What_ kind of driver you want to write !!

Thanks,
Durga
Regards
Durgadoss
Reply all
Reply to author
Forward
0 new messages