| 1231 | } |
| 1232 | |
| 1233 | rt_int32_t sdio_disable_func(struct rt_sdio_function *func) |
| 1234 | { |
| 1235 | rt_int32_t ret; |
| 1236 | rt_uint8_t reg; |
| 1237 | struct rt_sdio_function *func0; |
| 1238 | |
| 1239 | RT_ASSERT(func != RT_NULL); |
| 1240 | RT_ASSERT(func->card != RT_NULL); |
| 1241 | |
| 1242 | func0 = func->card->sdio_function[0]; |
| 1243 | |
| 1244 | mmcsd_dbg("SDIO: disabling function %d\n", func->num); |
| 1245 | |
| 1246 | reg = sdio_io_readb(func0, SDIO_REG_CCCR_IO_EN, &ret); |
| 1247 | if (ret) |
| 1248 | goto err; |
| 1249 | |
| 1250 | reg &= ~(1 << func->num); |
| 1251 | |
| 1252 | ret = sdio_io_writeb(func0, SDIO_REG_CCCR_IO_EN, reg); |
| 1253 | if (ret) |
| 1254 | goto err; |
| 1255 | |
| 1256 | mmcsd_dbg("SDIO: disabled function successfull\n"); |
| 1257 | |
| 1258 | return 0; |
| 1259 | |
| 1260 | err: |
| 1261 | mmcsd_dbg("SDIO: failed to disable function %d\n", func->num); |
| 1262 | return -RT_EIO; |
| 1263 | } |
| 1264 | |
| 1265 | void sdio_set_drvdata(struct rt_sdio_function *func, void *data) |
| 1266 | { |
nothing calls this directly
no test coverage detected