Lines Matching +full:quad +full:- +full:phase
1 // SPDX-License-Identifier: GPL-2.0
37 if (ftm->big_endian) in ftm_read()
38 *data = ioread32be(ftm->ftm_base + offset); in ftm_read()
40 *data = ioread32(ftm->ftm_base + offset); in ftm_read()
45 if (ftm->big_endian) in ftm_write()
46 iowrite32be(data, ftm->ftm_base + offset); in ftm_write()
48 iowrite32(data, ftm->ftm_base + offset); in ftm_write()
90 /* Select quad mode, reset other fields to zero */ in ftm_quaddec_init()
135 mutex_lock(&ftm->ftm_quaddec_mutex); in ftm_quaddec_set_prescaler()
144 mutex_unlock(&ftm->ftm_quaddec_mutex); in ftm_quaddec_set_prescaler()
181 dev_warn(&ftm->pdev->dev, "Can only accept '0' as new counter value\n"); in ftm_quaddec_count_write()
182 return -EINVAL; in ftm_quaddec_count_write()
219 .name = "Channel 1 Phase A"
223 .name = "Channel 1 Phase B"
264 struct device_node *node = pdev->dev.of_node; in ftm_quaddec_probe()
268 counter = devm_counter_alloc(&pdev->dev, sizeof(*ftm)); in ftm_quaddec_probe()
270 return -ENOMEM; in ftm_quaddec_probe()
275 dev_err(&pdev->dev, "Failed to get memory region\n"); in ftm_quaddec_probe()
276 return -ENODEV; in ftm_quaddec_probe()
279 ftm->pdev = pdev; in ftm_quaddec_probe()
280 ftm->big_endian = of_property_read_bool(node, "big-endian"); in ftm_quaddec_probe()
281 ftm->ftm_base = devm_ioremap(&pdev->dev, io->start, resource_size(io)); in ftm_quaddec_probe()
283 if (!ftm->ftm_base) { in ftm_quaddec_probe()
284 dev_err(&pdev->dev, "Failed to map memory region\n"); in ftm_quaddec_probe()
285 return -EINVAL; in ftm_quaddec_probe()
287 counter->name = dev_name(&pdev->dev); in ftm_quaddec_probe()
288 counter->parent = &pdev->dev; in ftm_quaddec_probe()
289 counter->ops = &ftm_quaddec_cnt_ops; in ftm_quaddec_probe()
290 counter->counts = &ftm_quaddec_counts; in ftm_quaddec_probe()
291 counter->num_counts = 1; in ftm_quaddec_probe()
292 counter->signals = ftm_quaddec_signals; in ftm_quaddec_probe()
293 counter->num_signals = ARRAY_SIZE(ftm_quaddec_signals); in ftm_quaddec_probe()
295 mutex_init(&ftm->ftm_quaddec_mutex); in ftm_quaddec_probe()
299 ret = devm_add_action_or_reset(&pdev->dev, ftm_quaddec_disable, ftm); in ftm_quaddec_probe()
303 ret = devm_counter_add(&pdev->dev, counter); in ftm_quaddec_probe()
305 return dev_err_probe(&pdev->dev, ret, "Failed to add counter\n"); in ftm_quaddec_probe()
311 { .compatible = "fsl,ftm-quaddec" },
317 .name = "ftm-quaddec",