Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mmc/mmc_fdt_helpers.c
| Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | cd_setup(struct mmc_helper *helper, phandle_t node) | ||||
| if (helper->props & MMC_PROP_NON_REMOVABLE) { | if (helper->props & MMC_PROP_NON_REMOVABLE) { | ||||
| helper->cd_disabled = true; | helper->cd_disabled = true; | ||||
| if (bootverbose) | if (bootverbose) | ||||
| device_printf(dev, "Non-removable media\n"); | device_printf(dev, "Non-removable media\n"); | ||||
| return; | return; | ||||
| } | } | ||||
| /* | /* | ||||
| * If the device has no card-detection, treat it as non-removable. | |||||
| * This could be improved by polling for detection. | |||||
| */ | |||||
| if (helper->props & MMC_PROP_BROKEN_CD) { | |||||
| helper->cd_disabled = true; | |||||
| if (bootverbose) | |||||
| device_printf(dev, "Broken card-detect\n"); | |||||
| return; | |||||
| } | |||||
| /* | |||||
| * If there is no cd-gpios property, then presumably the hardware | * If there is no cd-gpios property, then presumably the hardware | ||||
| * PRESENT_STATE register and interrupts will reflect card state | * PRESENT_STATE register and interrupts will reflect card state | ||||
| * properly, and there's nothing more for us to do. Our get_present() | * properly, and there's nothing more for us to do. Our get_present() | ||||
| * will return sdhci_generic_get_card_present() because cd_pin is NULL. | * will return sdhci_generic_get_card_present() because cd_pin is NULL. | ||||
| * | * | ||||
| * If there is a property, make sure we can read the pin. | * If there is a property, make sure we can read the pin. | ||||
| */ | */ | ||||
| if (gpio_pin_get_by_ofw_property(dev, node, "cd-gpios", | if (gpio_pin_get_by_ofw_property(dev, node, "cd-gpios", | ||||
| ▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines | |||||