Lines Matching +full:data +full:- +full:crci

1 // SPDX-License-Identifier: GPL-2.0-only
15 #include <dt-bindings/soc/qcom,gsbi.h>
83 { /* ADM 0 - B */
88 { /* ADM 0 - B */
93 { /* ADM 1 - A */
98 { /* ADM 1 - B */
113 u32 crci; member
118 { .compatible = "qcom,tcsr-ipq8064", .data = &config_ipq8064},
119 { .compatible = "qcom,tcsr-apq8064", .data = &config_apq8064},
120 { .compatible = "qcom,tcsr-msm8960", .data = &config_msm8960},
121 { .compatible = "qcom,tcsr-msm8660", .data = &config_msm8660},
127 struct device_node *node = pdev->dev.of_node; in gsbi_probe()
136 gsbi = devm_kzalloc(&pdev->dev, sizeof(*gsbi), GFP_KERNEL); in gsbi_probe()
139 return -ENOMEM; in gsbi_probe()
146 gsbi->tcsr = syscon_regmap_lookup_by_phandle(node, "syscon-tcsr"); in gsbi_probe()
148 if (!IS_ERR(gsbi->tcsr)) { in gsbi_probe()
149 tcsr_node = of_parse_phandle(node, "syscon-tcsr", 0); in gsbi_probe()
153 config = match->data; in gsbi_probe()
155 dev_warn(&pdev->dev, "no matching TCSR\n"); in gsbi_probe()
161 if (of_property_read_u32(node, "cell-index", &gsbi_num)) { in gsbi_probe()
162 dev_err(&pdev->dev, "missing cell-index\n"); in gsbi_probe()
163 return -EINVAL; in gsbi_probe()
167 dev_err(&pdev->dev, "invalid cell-index\n"); in gsbi_probe()
168 return -EINVAL; in gsbi_probe()
171 if (of_property_read_u32(node, "qcom,mode", &gsbi->mode)) { in gsbi_probe()
172 dev_err(&pdev->dev, "missing mode configuration\n"); in gsbi_probe()
173 return -EINVAL; in gsbi_probe()
177 of_property_read_u32(node, "qcom,crci", &gsbi->crci); in gsbi_probe()
179 dev_info(&pdev->dev, "GSBI port protocol: %d crci: %d\n", in gsbi_probe()
180 gsbi->mode, gsbi->crci); in gsbi_probe()
181 gsbi->hclk = devm_clk_get(&pdev->dev, "iface"); in gsbi_probe()
182 if (IS_ERR(gsbi->hclk)) in gsbi_probe()
183 return PTR_ERR(gsbi->hclk); in gsbi_probe()
185 clk_prepare_enable(gsbi->hclk); in gsbi_probe()
187 writel_relaxed((gsbi->mode << GSBI_PROTOCOL_SHIFT) | gsbi->crci, in gsbi_probe()
191 * modify tcsr to reflect mode and ADM CRCI mux in gsbi_probe()
196 for (i = 0; i < config->num_rows; i++) { in gsbi_probe()
197 mask = config->array[i][gsbi_num - 1]; in gsbi_probe()
199 if (gsbi->mode == GSBI_PROT_SPI) in gsbi_probe()
200 regmap_update_bits(gsbi->tcsr, in gsbi_probe()
203 regmap_update_bits(gsbi->tcsr, in gsbi_probe()
214 ret = of_platform_populate(node, NULL, NULL, &pdev->dev); in gsbi_probe()
216 clk_disable_unprepare(gsbi->hclk); in gsbi_probe()
224 clk_disable_unprepare(gsbi->hclk); in gsbi_remove()
230 { .compatible = "qcom,gsbi-v1.0.0", },