It is not trivial, it can be. The company designing the phone can choose components with mainline kernel support over others.
If you choose an SoC with decent support and, for example, a vibration module or modem with decent mainline support, you just have to write a device tree.
If you build a phone, you know what regulators exist, what voltages they have and where they connect.
It's not the type of reverse engineering I have to do myself, the phone company knows their own device.
And even if they task another company to do it, they can just write in their contract "provide us with the following" and they get what they need.
It's a lot easier for a phone company than for people doing it in their spare time by reverse engineering things.