dts: gen_defines: Remove lots of code duplication for phandle/val lists
dts: gen_defines: Remove lots of code duplication for phandle/val lists

Add a write_phandle_val_list() function for handling GPIOs, PWMs, and IO
channels. The logic is the same in all cases.

This also indirectly makes pwm-names and io-channel-names work the same
as gpio-names. Previously, they were ignored.

Also add a long explanation with example output.

Signed-off-by: Ulf Magnusson <01743f1c1deb1fe75271d62edb65757d98ac0bcb@nordicsemi.no>

zephyrproject-rtos/zephyr,nashif/zephyr,finikorg/zephyr,Vudentz/zephyr,Vudentz/zephyr,galak/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,finikorg/zephyr,nashif/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,galak/zephyr,nashif/zephyr,Vudentz/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,nashif/zephyr,Vudentz/zephyr,Vudentz/zephyr,finikorg/zephyr