Commit 84340785 authored by Gopikrishna Garmidi's avatar Gopikrishna Garmidi Committed by Linus Walleij
Browse files

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: default avatarGopikrishna Garmidi <gopikrishna.garmidi@oss.qualcomm.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: default avatarLinus Walleij <linusw@kernel.org>
parent 84a3bc33
Loading
Loading
Loading
Loading
+43 −3
Original line number Diff line number Diff line
@@ -1729,6 +1729,26 @@ static const struct msm_gpio_wakeirq_map glymur_pdc_map[] = {
	{ 232, 206 }, { 234, 172 }, { 235, 173 }, { 242, 158 }, { 244, 156 },
};

static const struct msm_gpio_wakeirq_map mahua_pdc_map[] = {
	{ 0, 116 },   { 2, 114 },   { 3, 115 },	  { 4, 175 },	{ 5, 176 },
	{ 7, 111 },   { 11, 129 },  { 13, 130 },  { 15, 112 },	{ 19, 113 },
	{ 23, 187 },  { 27, 188 },  { 28, 121 },  { 29, 122 },	{ 30, 136 },
	{ 31, 203 },  { 32, 189 },  { 34, 174 },  { 35, 190 },	{ 36, 191 },
	{ 39, 124 },  { 43, 192 },  { 47, 193 },  { 51, 123 },	{ 53, 133 },
	{ 55, 125 },  { 59, 131 },  { 64, 134 },  { 65, 150 },	{ 66, 186 },
	{ 67, 132 },  { 68, 195 },  { 71, 135 },  { 75, 196 },	{ 79, 197 },
	{ 83, 198 },  { 84, 181 },  { 85, 199 },  { 87, 200 },	{ 91, 201 },
	{ 92, 182 },  { 93, 183 },  { 94, 184 },  { 95, 185 },	{ 98, 202 },
	{ 105, 157 }, { 113, 128 }, { 121, 117 }, { 123, 118 }, { 125, 119 },
	{ 129, 120 }, { 131, 126 }, { 132, 160 }, { 133, 194 }, { 134, 127 },
	{ 141, 137 }, { 144, 138 }, { 145, 139 }, { 147, 140 }, { 148, 141 },
	{ 150, 146 }, { 151, 147 }, { 153, 148 }, { 154, 144 }, { 155, 159 },
	{ 156, 149 }, { 157, 151 }, { 163, 142 }, { 172, 143 }, { 181, 145 },
	{ 193, 161 }, { 196, 152 }, { 203, 177 }, { 208, 178 }, { 215, 162 },
	{ 217, 153 }, { 220, 154 }, { 221, 155 }, { 228, 179 }, { 230, 180 },
	{ 232, 206 }, { 234, 172 }, { 235, 173 }, { 242, 158 }, { 244, 156 },
};

static const struct msm_pinctrl_soc_data glymur_tlmm = {
	.pins = glymur_pins,
	.npins = ARRAY_SIZE(glymur_pins),
@@ -1742,14 +1762,34 @@ static const struct msm_pinctrl_soc_data glymur_tlmm = {
	.egpio_func = 11,
};

static const struct msm_pinctrl_soc_data mahua_tlmm = {
	.pins = glymur_pins,
	.npins = ARRAY_SIZE(glymur_pins),
	.functions = glymur_functions,
	.nfunctions = ARRAY_SIZE(glymur_functions),
	.groups = glymur_groups,
	.ngroups = ARRAY_SIZE(glymur_groups),
	.ngpios = 251,
	.wakeirq_map = mahua_pdc_map,
	.nwakeirq_map = ARRAY_SIZE(mahua_pdc_map),
	.egpio_func = 11,
};

static const struct of_device_id glymur_tlmm_of_match[] = {
	{ .compatible = "qcom,glymur-tlmm", },
	{ }
	{ .compatible = "qcom,glymur-tlmm", .data = &glymur_tlmm },
	{ .compatible = "qcom,mahua-tlmm", .data = &mahua_tlmm },
	{ },
};

static int glymur_tlmm_probe(struct platform_device *pdev)
{
	return msm_pinctrl_probe(pdev, &glymur_tlmm);
	const struct msm_pinctrl_soc_data *data;

	data = of_device_get_match_data(&pdev->dev);
	if (!data)
		return -ENODEV;

	return msm_pinctrl_probe(pdev, data);
}

static struct platform_driver glymur_tlmm_driver = {