Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: qcom: glymur: Add Mahua TLMM support

Mahua TLMM block is identical to Glymur, but the PDC wake IRQ map
differs since PDC handles the interrupt for GPIO 155 instead of GPIO 143
as seen on Glymur. Hence add the Mahua-specific PDC map to the Glymur
TLMM driver.

Signed-off-by: Gopikrishna Garmidi <gopikrishna.garmidi@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>

authored by

Gopikrishna Garmidi and committed by
Linus Walleij
84340785 84a3bc33

+43 -3
+43 -3
drivers/pinctrl/qcom/pinctrl-glymur.c
··· 1729 1729 { 232, 206 }, { 234, 172 }, { 235, 173 }, { 242, 158 }, { 244, 156 }, 1730 1730 }; 1731 1731 1732 + static const struct msm_gpio_wakeirq_map mahua_pdc_map[] = { 1733 + { 0, 116 }, { 2, 114 }, { 3, 115 }, { 4, 175 }, { 5, 176 }, 1734 + { 7, 111 }, { 11, 129 }, { 13, 130 }, { 15, 112 }, { 19, 113 }, 1735 + { 23, 187 }, { 27, 188 }, { 28, 121 }, { 29, 122 }, { 30, 136 }, 1736 + { 31, 203 }, { 32, 189 }, { 34, 174 }, { 35, 190 }, { 36, 191 }, 1737 + { 39, 124 }, { 43, 192 }, { 47, 193 }, { 51, 123 }, { 53, 133 }, 1738 + { 55, 125 }, { 59, 131 }, { 64, 134 }, { 65, 150 }, { 66, 186 }, 1739 + { 67, 132 }, { 68, 195 }, { 71, 135 }, { 75, 196 }, { 79, 197 }, 1740 + { 83, 198 }, { 84, 181 }, { 85, 199 }, { 87, 200 }, { 91, 201 }, 1741 + { 92, 182 }, { 93, 183 }, { 94, 184 }, { 95, 185 }, { 98, 202 }, 1742 + { 105, 157 }, { 113, 128 }, { 121, 117 }, { 123, 118 }, { 125, 119 }, 1743 + { 129, 120 }, { 131, 126 }, { 132, 160 }, { 133, 194 }, { 134, 127 }, 1744 + { 141, 137 }, { 144, 138 }, { 145, 139 }, { 147, 140 }, { 148, 141 }, 1745 + { 150, 146 }, { 151, 147 }, { 153, 148 }, { 154, 144 }, { 155, 159 }, 1746 + { 156, 149 }, { 157, 151 }, { 163, 142 }, { 172, 143 }, { 181, 145 }, 1747 + { 193, 161 }, { 196, 152 }, { 203, 177 }, { 208, 178 }, { 215, 162 }, 1748 + { 217, 153 }, { 220, 154 }, { 221, 155 }, { 228, 179 }, { 230, 180 }, 1749 + { 232, 206 }, { 234, 172 }, { 235, 173 }, { 242, 158 }, { 244, 156 }, 1750 + }; 1751 + 1732 1752 static const struct msm_pinctrl_soc_data glymur_tlmm = { 1733 1753 .pins = glymur_pins, 1734 1754 .npins = ARRAY_SIZE(glymur_pins), ··· 1762 1742 .egpio_func = 11, 1763 1743 }; 1764 1744 1745 + static const struct msm_pinctrl_soc_data mahua_tlmm = { 1746 + .pins = glymur_pins, 1747 + .npins = ARRAY_SIZE(glymur_pins), 1748 + .functions = glymur_functions, 1749 + .nfunctions = ARRAY_SIZE(glymur_functions), 1750 + .groups = glymur_groups, 1751 + .ngroups = ARRAY_SIZE(glymur_groups), 1752 + .ngpios = 251, 1753 + .wakeirq_map = mahua_pdc_map, 1754 + .nwakeirq_map = ARRAY_SIZE(mahua_pdc_map), 1755 + .egpio_func = 11, 1756 + }; 1757 + 1765 1758 static const struct of_device_id glymur_tlmm_of_match[] = { 1766 - { .compatible = "qcom,glymur-tlmm", }, 1767 - { } 1759 + { .compatible = "qcom,glymur-tlmm", .data = &glymur_tlmm }, 1760 + { .compatible = "qcom,mahua-tlmm", .data = &mahua_tlmm }, 1761 + { }, 1768 1762 }; 1769 1763 1770 1764 static int glymur_tlmm_probe(struct platform_device *pdev) 1771 1765 { 1772 - return msm_pinctrl_probe(pdev, &glymur_tlmm); 1766 + const struct msm_pinctrl_soc_data *data; 1767 + 1768 + data = of_device_get_match_data(&pdev->dev); 1769 + if (!data) 1770 + return -ENODEV; 1771 + 1772 + return msm_pinctrl_probe(pdev, data); 1773 1773 } 1774 1774 1775 1775 static struct platform_driver glymur_tlmm_driver = {