Lines Matching +full:data +full:- +full:transfer
1 // SPDX-License-Identifier: GPL-2.0-only
51 for (i = flash->caps->addr_width; i > 0; i--, addr >>= 8) in mchp23k256_addr2cmd()
57 return 1 + flash->caps->addr_width; in mchp23k256_cmdsz()
64 struct spi_transfer transfer[2] = {}; in mchp23k256_write() local
76 transfer[0].tx_buf = command; in mchp23k256_write()
77 transfer[0].len = cmd_len; in mchp23k256_write()
78 spi_message_add_tail(&transfer[0], &message); in mchp23k256_write()
80 transfer[1].tx_buf = buf; in mchp23k256_write()
81 transfer[1].len = len; in mchp23k256_write()
82 spi_message_add_tail(&transfer[1], &message); in mchp23k256_write()
84 mutex_lock(&flash->lock); in mchp23k256_write()
86 ret = spi_sync(flash->spi, &message); in mchp23k256_write()
88 mutex_unlock(&flash->lock); in mchp23k256_write()
94 *retlen += message.actual_length - cmd_len; in mchp23k256_write()
103 struct spi_transfer transfer[2] = {}; in mchp23k256_read() local
112 memset(&transfer, 0, sizeof(transfer)); in mchp23k256_read()
116 transfer[0].tx_buf = command; in mchp23k256_read()
117 transfer[0].len = cmd_len; in mchp23k256_read()
118 spi_message_add_tail(&transfer[0], &message); in mchp23k256_read()
120 transfer[1].rx_buf = buf; in mchp23k256_read()
121 transfer[1].len = len; in mchp23k256_read()
122 spi_message_add_tail(&transfer[1], &message); in mchp23k256_read()
124 mutex_lock(&flash->lock); in mchp23k256_read()
126 ret = spi_sync(flash->spi, &message); in mchp23k256_read()
128 mutex_unlock(&flash->lock); in mchp23k256_read()
134 *retlen += message.actual_length - cmd_len; in mchp23k256_read()
145 struct spi_transfer transfer = {}; in mchp23k256_set_mode() local
154 transfer.tx_buf = command; in mchp23k256_set_mode()
155 transfer.len = sizeof(command); in mchp23k256_set_mode()
156 spi_message_add_tail(&transfer, &message); in mchp23k256_set_mode()
174 struct flash_platform_data *data; in mchp23k256_probe() local
177 flash = devm_kzalloc(&spi->dev, sizeof(*flash), GFP_KERNEL); in mchp23k256_probe()
179 return -ENOMEM; in mchp23k256_probe()
181 flash->spi = spi; in mchp23k256_probe()
182 mutex_init(&flash->lock); in mchp23k256_probe()
189 data = dev_get_platdata(&spi->dev); in mchp23k256_probe()
191 flash->caps = of_device_get_match_data(&spi->dev); in mchp23k256_probe()
192 if (!flash->caps) in mchp23k256_probe()
193 flash->caps = &mchp23k256_caps; in mchp23k256_probe()
195 mtd_set_of_node(&flash->mtd, spi->dev.of_node); in mchp23k256_probe()
196 flash->mtd.dev.parent = &spi->dev; in mchp23k256_probe()
197 flash->mtd.type = MTD_RAM; in mchp23k256_probe()
198 flash->mtd.flags = MTD_CAP_RAM; in mchp23k256_probe()
199 flash->mtd.writesize = 1; in mchp23k256_probe()
200 flash->mtd.size = flash->caps->size; in mchp23k256_probe()
201 flash->mtd._read = mchp23k256_read; in mchp23k256_probe()
202 flash->mtd._write = mchp23k256_write; in mchp23k256_probe()
204 err = mtd_device_register(&flash->mtd, data ? data->parts : NULL, in mchp23k256_probe()
205 data ? data->nr_parts : 0); in mchp23k256_probe()
216 WARN_ON(mtd_device_unregister(&flash->mtd)); in mchp23k256_remove()
222 .data = &mchp23k256_caps,
226 .data = &mchp23lcv1024_caps,