how to identify what files would be compiled

I want to understand the GPIO framework of the linux, so i want to have a look at the source, but not sure what files would be compiled in the gpio folder looking at source , i know i can find it if i compile and see the obj folder i may find ,

please let me know , if there is any file which would convey what files of a module lets say GPIO or SPI or any peripheral will be compiled

You could start by reading the GPIO docs here:

Or the SPI stuff here:

After that, try reading up on sysfs, which is the system that allows access to GPIO and SPI in Linux.


i want to read the kernel files, any way thanks for good reference


sorry to repeat, my question is
what files are been compiled out of big kernel tree, so if i want to read a GPIO module of beagleboneblack , what files in the gpio source folder are compiled so that i can read only those files which are of concern can be understood, i think you got my question

after download and compile of linux kernel for beaglebone black i found these files are been picked and compiled

built-in.o gpiolib.o gpio-of-helper.o gpio-pcf857x.o
devres.o gpiolib-of.o gpio-omap.o gpio-twl4030.o

but any way which of these are actually been used for beaglebone black, because i see pcf857 as gpio expander (is that present on bbb?), gpiolib for optional use, any way ‘open firmware’ files i have to look at them, left is omap based file is that the main file to be looked at ?

Shyam, the beaglebone has am335x Sitara processor, which used to be in the family of omap3 processors by ti before they rebranded it. So the relevant file that implements gpio at the lower levels is gpio-omap.c, gpiolib.c is what calls into it.
If you want to see how it gets called into, you could print a stack dump to syslog by calling dump_stack() in, for example, _set_gpio_dataout_reg in gpio-omap.c.