gpio: sch: Consolidate similar algorithms
gpio: sch: Consolidate similar algorithms

Consolidating similar algorithms into common functions to make
GPIO SCH simpler and manageable.

Signed-off-by: Chang Rebecca Swee Fun <88a153230f63157278771f6cd28877966cb40c57@intel.com>
Reviewed-by: Alexandre Courbot <301cd6a3ea50a894b4b51e385c5eb12b9a4ffc0c@nvidia.com>
Reviewed-by: Mika Westerberg <afb75201fb002d7fdd2b0b231e006999e00db8a9@linux.intel.com>
Signed-off-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@linaro.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs