1 // SPDX-License-Identifier: GPL-2.0+
4 * Angelo Dureghello <angleo@sysam.it>
6 * CPU specific dspi routines
10 #include <asm/immap.h>
14 void dspi_chip_select(int cs)
16 struct gpio *gpio = (struct gpio *)MMAP_GPIO;
20 clrbits_8(&gpio->par_dspi, GPIO_PAR_DSPI_PCS0_UNMASK);
21 setbits_8(&gpio->par_dspi, GPIO_PAR_DSPI_PCS0_PCS0);
24 clrbits_8(&gpio->par_timer, ~GPIO_PAR_TIMER_T2IN_UNMASK);
25 setbits_8(&gpio->par_timer, GPIO_PAR_TIMER_T2IN_DSPIPCS2);
30 void dspi_chip_unselect(int cs)
32 struct gpio *gpio = (struct gpio *)MMAP_GPIO;
36 clrbits_8(&gpio->par_dspi, GPIO_PAR_DSPI_PCS0_PCS0);
39 clrbits_8(&gpio->par_timer, ~GPIO_PAR_TIMER_T2IN_UNMASK);
43 #endif /* CONFIG_CF_DSPI */