pinctrl: qcom: add pinctrl and gpio drivers for SDM845 SoC

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Stephan Gerhold <stephan@gerhold.net>
[trini: Add CONFIG_SDM845 around sdm845_data usage]
diff --git a/drivers/gpio/pm8916_gpio.c b/drivers/gpio/pm8916_gpio.c
index 40b0f25..7ad9578 100644
--- a/drivers/gpio/pm8916_gpio.c
+++ b/drivers/gpio/pm8916_gpio.c
@@ -202,6 +202,7 @@
 static const struct udevice_id pm8916_gpio_ids[] = {
 	{ .compatible = "qcom,pm8916-gpio" },
 	{ .compatible = "qcom,pm8994-gpio" },	/* 22 GPIO's */
+	{ .compatible = "qcom,pm8998-gpio" },
 	{ }
 };
 
@@ -266,7 +267,7 @@
 		return log_msg_ret("bad type", -ENXIO);
 
 	reg = pmic_reg_read(dev->parent, priv->pid + REG_SUBTYPE);
-	if (reg != 0x1)
+	if ((reg & 0x5) == 0)
 		return log_msg_ret("bad subtype", -ENXIO);
 
 	return 0;
@@ -287,11 +288,12 @@
 static const struct udevice_id pm8941_pwrkey_ids[] = {
 	{ .compatible = "qcom,pm8916-pwrkey" },
 	{ .compatible = "qcom,pm8994-pwrkey" },
+	{ .compatible = "qcom,pm8998-pwrkey" },
 	{ }
 };
 
-U_BOOT_DRIVER(pwrkey_pm8941) = {
-	.name	= "pwrkey_pm8916",
+U_BOOT_DRIVER(pwrkey_pm89xx) = {
+	.name	= "pwrkey_pm89xx",
 	.id	= UCLASS_GPIO,
 	.of_match = pm8941_pwrkey_ids,
 	.of_to_plat = pm8941_pwrkey_of_to_plat,