From 83006a56dbcc27166abe0711a9a7f4e23750d183 Mon Sep 17 00:00:00 2001 From: Sudharsan Reddy Yettapu Date: Thu, 19 Sep 2019 12:11:42 +0530 Subject: [PATCH] drivers: irqchip: qcom: Add mdm9607 pin data for mpm Add the mpm pin input mapping for mdm9607 chipset. Change-Id: I9498b1425818601f81246a7a887d48d2ba71af76 Signed-off-by: Sudharsan Reddy Yettapu Signed-off-by: Sivasri Kumar Vanka --- .../bindings/interrupt-controller/qti,mpm.txt | 2 + drivers/irqchip/qcom/Makefile | 3 +- drivers/irqchip/qcom/mpm-9607.c | 67 +++++++++++++++++++ drivers/irqchip/qcom/mpm.c | 8 +++ drivers/irqchip/qcom/mpm.h | 4 ++ 5 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 drivers/irqchip/qcom/mpm-9607.c diff --git a/Documentation/devicetree/bindings/interrupt-controller/qti,mpm.txt b/Documentation/devicetree/bindings/interrupt-controller/qti,mpm.txt index 551c8b8b7aa4..7e5b6f65b2f9 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/qti,mpm.txt +++ b/Documentation/devicetree/bindings/interrupt-controller/qti,mpm.txt @@ -23,6 +23,7 @@ Properties: "qcom,mpm-gic-msm8937", "qcom,mpm-gic-qcs405" "qcom,mpm-gic-trinket" + "qcom,mpm-gic-mdm9607" - interrupts: Usage: required @@ -81,6 +82,7 @@ properties: "qcom,mpm-gpio-msm8937", "qcom,mpm-gpio-qcs405" "qcom,mpm-gpio-trinket", + "qcom,mpm-gpio-mdm9607" - interrupt-parent: Usage: required diff --git a/drivers/irqchip/qcom/Makefile b/drivers/irqchip/qcom/Makefile index c6da717e5068..e038b76ec5ca 100644 --- a/drivers/irqchip/qcom/Makefile +++ b/drivers/irqchip/qcom/Makefile @@ -4,4 +4,5 @@ obj-$(CONFIG_QTI_PDC_SM6150) += pdc-sm6150.o obj-$(CONFIG_QTI_PDC_SDMMAGPIE) += pdc-sdmmagpie.o obj-$(CONFIG_QTI_PDC_SDXPRAIRIE) += pdc-sdxprairie.o obj-$(CONFIG_QTI_PDC_ATOLL) += pdc-atoll.o -obj-$(CONFIG_QTI_MPM) += mpm.o mpm-8937.o mpm-qcs405.o mpm-trinket.o +obj-$(CONFIG_QTI_MPM) += mpm.o mpm-8937.o mpm-qcs405.o mpm-trinket.o \ + mpm-9607.o diff --git a/drivers/irqchip/qcom/mpm-9607.c b/drivers/irqchip/qcom/mpm-9607.c new file mode 100644 index 000000000000..92659afe4252 --- /dev/null +++ b/drivers/irqchip/qcom/mpm-9607.c @@ -0,0 +1,67 @@ +/* Copyright (c) 2018, 2019 The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "mpm.h" + +const struct mpm_pin mpm_mdm9607_gic_chip_data[] = { + {2, 216}, /* tsens_upper_lower_int */ + {49, 172}, /* usb1_hs_async_wakeup_irq */ + {51, 174}, /* usb2_hs_async_wakeup_irq */ + {53, 104}, /* mdss_irq */ + {58, 166}, /* usb_hs_irq */ + {62, 222}, /* ee0_apps_hlos_spmi_periph_irq */ + {-1}, +}; + +const struct mpm_pin mpm_mdm9607_gpio_chip_data[] = { + {3, 16}, + {4, 5}, + {5, 11}, + {6, 12}, + {7, 3}, + {8, 17}, + {9, 9}, + {10, 13}, + {11, 1}, + {12, 20}, + {13, 21}, + {14, 22}, + {15, 75}, + {16, 74}, + {17, 28}, + {18, 44}, + {19, 26}, + {20, 43}, + {21, 42}, + {22, 29}, + {23, 69}, + {24, 30}, + {25, 37}, + {26, 25}, + {27, 71}, + {28, 34}, + {29, 55}, + {30, 8}, + {31, 40}, + {32, 48}, + {33, 52}, + {34, 57}, + {35, 62}, + {36, 66}, + {37, 59}, + {38, 79}, + {39, 38}, + {40, 63}, + {41, 76}, + {-1}, +}; diff --git a/drivers/irqchip/qcom/mpm.c b/drivers/irqchip/qcom/mpm.c index 0a31aee8da6f..7dc0a0d4b037 100644 --- a/drivers/irqchip/qcom/mpm.c +++ b/drivers/irqchip/qcom/mpm.c @@ -601,6 +601,10 @@ reg_base_err: } static const struct of_device_id mpm_gic_chip_data_table[] = { + { + .compatible = "qcom,mpm-gic-mdm9607", + .data = mpm_mdm9607_gic_chip_data, + }, { .compatible = "qcom,mpm-gic-msm8937", .data = mpm_msm8937_gic_chip_data, @@ -618,6 +622,10 @@ static const struct of_device_id mpm_gic_chip_data_table[] = { MODULE_DEVICE_TABLE(of, mpm_gic_chip_data_table); static const struct of_device_id mpm_gpio_chip_data_table[] = { + { + .compatible = "qcom,mpm-gpio-mdm9607", + .data = mpm_mdm9607_gpio_chip_data, + }, { .compatible = "qcom,mpm-gpio-msm8937", .data = mpm_msm8937_gpio_chip_data, diff --git a/drivers/irqchip/qcom/mpm.h b/drivers/irqchip/qcom/mpm.h index 209994e2b980..3bee7c8981cc 100644 --- a/drivers/irqchip/qcom/mpm.h +++ b/drivers/irqchip/qcom/mpm.h @@ -28,4 +28,8 @@ extern const struct mpm_pin mpm_qcs405_gic_chip_data[]; extern const struct mpm_pin mpm_qcs405_gpio_chip_data[]; extern const struct mpm_pin mpm_trinket_gic_chip_data[]; extern const struct mpm_pin mpm_trinket_gpio_chip_data[]; + +extern const struct mpm_pin mpm_mdm9607_gic_chip_data[]; +extern const struct mpm_pin mpm_mdm9607_gpio_chip_data[]; + #endif /* __QCOM_MPM_H__ */