• Home
  • Raw
  • Download

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()
121 struct ftm_quaddec *ftm = counter->priv; in ftm_quaddec_get_prescaler()
135 struct ftm_quaddec *ftm = counter->priv; in ftm_quaddec_set_prescaler()
137 mutex_lock(&ftm->ftm_quaddec_mutex); in ftm_quaddec_set_prescaler()
146 mutex_unlock(&ftm->ftm_quaddec_mutex); in ftm_quaddec_set_prescaler()
183 struct ftm_quaddec *const ftm = counter->priv; in ftm_quaddec_count_read()
197 struct ftm_quaddec *const ftm = counter->priv; in ftm_quaddec_count_write()
200 dev_warn(&ftm->pdev->dev, "Can only accept '0' as new counter value\n"); in ftm_quaddec_count_write()
201 return -EINVAL; in ftm_quaddec_count_write()
238 .name = "Channel 1 Phase A"
242 .name = "Channel 1 Phase B"
279 struct device_node *node = pdev->dev.of_node; in ftm_quaddec_probe()
283 ftm = devm_kzalloc(&pdev->dev, sizeof(*ftm), GFP_KERNEL); in ftm_quaddec_probe()
285 return -ENOMEM; in ftm_quaddec_probe()
291 dev_err(&pdev->dev, "Failed to get memory region\n"); in ftm_quaddec_probe()
292 return -ENODEV; in ftm_quaddec_probe()
295 ftm->pdev = pdev; in ftm_quaddec_probe()
296 ftm->big_endian = of_property_read_bool(node, "big-endian"); in ftm_quaddec_probe()
297 ftm->ftm_base = devm_ioremap(&pdev->dev, io->start, resource_size(io)); in ftm_quaddec_probe()
299 if (!ftm->ftm_base) { in ftm_quaddec_probe()
300 dev_err(&pdev->dev, "Failed to map memory region\n"); in ftm_quaddec_probe()
301 return -EINVAL; in ftm_quaddec_probe()
303 ftm->counter.name = dev_name(&pdev->dev); in ftm_quaddec_probe()
304 ftm->counter.parent = &pdev->dev; in ftm_quaddec_probe()
305 ftm->counter.ops = &ftm_quaddec_cnt_ops; in ftm_quaddec_probe()
306 ftm->counter.counts = &ftm_quaddec_counts; in ftm_quaddec_probe()
307 ftm->counter.num_counts = 1; in ftm_quaddec_probe()
308 ftm->counter.signals = ftm_quaddec_signals; in ftm_quaddec_probe()
309 ftm->counter.num_signals = ARRAY_SIZE(ftm_quaddec_signals); in ftm_quaddec_probe()
310 ftm->counter.priv = ftm; in ftm_quaddec_probe()
312 mutex_init(&ftm->ftm_quaddec_mutex); in ftm_quaddec_probe()
316 ret = devm_add_action_or_reset(&pdev->dev, ftm_quaddec_disable, ftm); in ftm_quaddec_probe()
320 ret = devm_counter_register(&pdev->dev, &ftm->counter); in ftm_quaddec_probe()
328 { .compatible = "fsl,ftm-quaddec" },
334 .name = "ftm-quaddec",