mmc_helpers.c (4a331971d2f1083f35b87197da0614fa3e0e53cb) | mmc_helpers.c (b344de4d0d163cbd8bf88cb5d226c18fe96f488f) |
---|---|
1/* 2 * Copyright 2019 Emmanuel Vadot <manu@freebsd.org> 3 * Copyright (c) 2017 Ian Lepore <ian@freebsd.org> All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: 8 * --- 75 unchanged lines hidden (view full) --- 84 host->caps |= MMC_CAP_MMC_HS400_180 | MMC_CAP_SIGNALING_180; 85 if (device_has_property(dev, "mmc-hs400-enhanced-strobe")) 86 host->caps |= MMC_CAP_MMC_ENH_STROBE; 87} 88 89int 90mmc_parse(device_t dev, struct mmc_helper *helper, struct mmc_host *host) 91{ | 1/* 2 * Copyright 2019 Emmanuel Vadot <manu@freebsd.org> 3 * Copyright (c) 2017 Ian Lepore <ian@freebsd.org> All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: 8 * --- 75 unchanged lines hidden (view full) --- 84 host->caps |= MMC_CAP_MMC_HS400_180 | MMC_CAP_SIGNALING_180; 85 if (device_has_property(dev, "mmc-hs400-enhanced-strobe")) 86 host->caps |= MMC_CAP_MMC_ENH_STROBE; 87} 88 89int 90mmc_parse(device_t dev, struct mmc_helper *helper, struct mmc_host *host) 91{ |
92 uint64_t bus_width, max_freq; | 92 uint32_t bus_width, max_freq; |
93 94 bus_width = 0; | 93 94 bus_width = 0; |
95 if (device_get_property(dev, "bus-width", &bus_width, sizeof(uint64_t)) <= 0) | 95 if (device_get_property(dev, "bus-width", &bus_width, 96 sizeof(bus_width), DEVICE_PROP_UINT32) <= 0) |
96 bus_width = 1; 97 98 if (bus_width >= 4) 99 host->caps |= MMC_CAP_4_BIT_DATA; 100 if (bus_width >= 8) 101 host->caps |= MMC_CAP_8_BIT_DATA; 102 103 /* 104 * max-frequency is optional, drivers should tweak this value 105 * if it's not present based on the clock that the mmc controller 106 * operates on 107 */ 108 if (device_get_property(dev, "max-frequency", &max_freq, | 97 bus_width = 1; 98 99 if (bus_width >= 4) 100 host->caps |= MMC_CAP_4_BIT_DATA; 101 if (bus_width >= 8) 102 host->caps |= MMC_CAP_8_BIT_DATA; 103 104 /* 105 * max-frequency is optional, drivers should tweak this value 106 * if it's not present based on the clock that the mmc controller 107 * operates on 108 */ 109 if (device_get_property(dev, "max-frequency", &max_freq, |
109 sizeof(uint64_t)) > 0) | 110 sizeof(max_freq), DEVICE_PROP_UINT32) > 0) |
110 host->f_max = max_freq; 111 112 if (device_has_property(dev, "broken-cd")) 113 helper->props |= MMC_PROP_BROKEN_CD; 114 if (device_has_property(dev, "non-removable")) 115 helper->props |= MMC_PROP_NON_REMOVABLE; 116 if (device_has_property(dev, "wp-inverted")) 117 helper->props |= MMC_PROP_WP_INVERTED; --- 17 unchanged lines hidden --- | 111 host->f_max = max_freq; 112 113 if (device_has_property(dev, "broken-cd")) 114 helper->props |= MMC_PROP_BROKEN_CD; 115 if (device_has_property(dev, "non-removable")) 116 helper->props |= MMC_PROP_NON_REMOVABLE; 117 if (device_has_property(dev, "wp-inverted")) 118 helper->props |= MMC_PROP_WP_INVERTED; --- 17 unchanged lines hidden --- |