MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / sdio_disable_func

Function sdio_disable_func

components/drivers/sdio/dev_sdio.c:1233–1263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1231}
1232
1233rt_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
1260err:
1261 mmcsd_dbg("SDIO: failed to disable function %d\n", func->num);
1262 return -RT_EIO;
1263}
1264
1265void sdio_set_drvdata(struct rt_sdio_function *func, void *data)
1266{

Callers

nothing calls this directly

Calls 2

sdio_io_readbFunction · 0.85
sdio_io_writebFunction · 0.85

Tested by

no test coverage detected