Lines Matching refs:spi

38 static void slic_write(struct spi_device *spi, u16 addr,  in slic_write()  argument
50 spi_write(spi, &temp[0], SLIC_THREE_LEN); in slic_write()
53 static u8 slic_read(struct spi_device *spi, u16 addr) in slic_read() argument
62 spi_write_then_read(spi, &temp[0], SLIC_TWO_LEN, &data, in slic_read()
69 static bool get_slic_product_code(struct spi_device *spi) in get_slic_product_code() argument
73 device_id = slic_read(spi, DS26522_IDR_ADDR); in get_slic_product_code()
80 static void ds26522_e1_spec_config(struct spi_device *spi) in ds26522_e1_spec_config() argument
83 slic_write(spi, DS26522_RMMR_ADDR, DS26522_RMMR_E1); in ds26522_e1_spec_config()
86 slic_write(spi, DS26522_TMMR_ADDR, DS26522_TMMR_E1); in ds26522_e1_spec_config()
89 slic_write(spi, DS26522_RMMR_ADDR, in ds26522_e1_spec_config()
90 slic_read(spi, DS26522_RMMR_ADDR) | DS26522_RMMR_FRM_EN); in ds26522_e1_spec_config()
93 slic_write(spi, DS26522_TMMR_ADDR, in ds26522_e1_spec_config()
94 slic_read(spi, DS26522_TMMR_ADDR) | DS26522_TMMR_FRM_EN); in ds26522_e1_spec_config()
97 slic_write(spi, DS26522_RCR1_ADDR, in ds26522_e1_spec_config()
101 slic_write(spi, DS26522_RIOCR_ADDR, in ds26522_e1_spec_config()
105 slic_write(spi, DS26522_TCR1_ADDR, DS26522_TCR1_TB8ZS); in ds26522_e1_spec_config()
108 slic_write(spi, DS26522_TIOCR_ADDR, in ds26522_e1_spec_config()
112 slic_write(spi, DS26522_E1TAF_ADDR, DS26522_E1TAF_DEFAULT); in ds26522_e1_spec_config()
115 slic_write(spi, DS26522_E1TNAF_ADDR, DS26522_E1TNAF_DEFAULT); in ds26522_e1_spec_config()
118 slic_write(spi, DS26522_RMMR_ADDR, slic_read(spi, DS26522_RMMR_ADDR) | in ds26522_e1_spec_config()
122 slic_write(spi, DS26522_TMMR_ADDR, slic_read(spi, DS26522_TMMR_ADDR) | in ds26522_e1_spec_config()
126 slic_write(spi, DS26522_LTRCR_ADDR, DS26522_LTRCR_E1); in ds26522_e1_spec_config()
129 slic_write(spi, DS26522_LTITSR_ADDR, in ds26522_e1_spec_config()
133 slic_write(spi, DS26522_LRISMR_ADDR, in ds26522_e1_spec_config()
137 slic_write(spi, DS26522_LMCR_ADDR, DS26522_LMCR_TE); in ds26522_e1_spec_config()
140 static int slic_ds26522_init_configure(struct spi_device *spi) in slic_ds26522_init_configure() argument
145 slic_write(spi, DS26522_GTCCR_ADDR, DS26522_GTCCR_BPREFSEL_REFCLKIN | in slic_ds26522_init_configure()
148 slic_write(spi, DS26522_GTCR2_ADDR, DS26522_GTCR2_TSSYNCOUT); in slic_ds26522_init_configure()
149 slic_write(spi, DS26522_GFCR_ADDR, DS26522_GFCR_BPCLK_2048KHZ); in slic_ds26522_init_configure()
152 slic_write(spi, DS26522_GTCR1_ADDR, DS26522_GTCR1); in slic_ds26522_init_configure()
155 slic_write(spi, DS26522_GLSRR_ADDR, DS26522_GLSRR_RESET); in slic_ds26522_init_configure()
158 slic_write(spi, DS26522_GFSRR_ADDR, DS26522_GFSRR_RESET); in slic_ds26522_init_configure()
162 slic_write(spi, DS26522_GLSRR_ADDR, DS26522_GLSRR_NORMAL); in slic_ds26522_init_configure()
163 slic_write(spi, DS26522_GFSRR_ADDR, DS26522_GFSRR_NORMAL); in slic_ds26522_init_configure()
166 slic_write(spi, DS26522_RMMR_ADDR, DS26522_RMMR_SFTRST); in slic_ds26522_init_configure()
169 slic_write(spi, DS26522_TMMR_ADDR, DS26522_TMMR_SFTRST); in slic_ds26522_init_configure()
176 slic_write(spi, addr, 0); in slic_ds26522_init_configure()
180 slic_write(spi, addr, 0); in slic_ds26522_init_configure()
184 slic_write(spi, addr, 0); in slic_ds26522_init_configure()
188 slic_write(spi, addr, 0); in slic_ds26522_init_configure()
191 ds26522_e1_spec_config(spi); in slic_ds26522_init_configure()
193 slic_write(spi, DS26522_GTCR1_ADDR, 0x00); in slic_ds26522_init_configure()
198 static void slic_ds26522_remove(struct spi_device *spi) in slic_ds26522_remove() argument
203 static int slic_ds26522_probe(struct spi_device *spi) in slic_ds26522_probe() argument
207 g_spi = spi; in slic_ds26522_probe()
208 spi->bits_per_word = 8; in slic_ds26522_probe()
210 if (!get_slic_product_code(spi)) in slic_ds26522_probe()
213 ret = slic_ds26522_init_configure(spi); in slic_ds26522_probe()
215 pr_info("DS26522 cs%d configured\n", spi_get_chipselect(spi, 0)); in slic_ds26522_probe()
224 MODULE_DEVICE_TABLE(spi, slic_ds26522_id);