Android hardware data from the kernel


How do I write device drivers for Android devices (SoC)? I want to write a GPS or camera driver (or output from GPS hardware) from the kernel.

In essence, I want to understand the device driver development process for SoC devices running Linux kernels. Which bus is used? How exactly will the data be transferred to the userspace HAL?

I've tried to read about HAL, but it does not indicate how HAL interacts with the hardware through the kernel. Can someone help me to understand that?