Lines Matching refs:host
36 struct mmc_host *host = dev_id; in mmc_gpio_cd_irqt() local
38 host->trigger_card_event = true; in mmc_gpio_cd_irqt()
39 mmc_detect_change(host, msecs_to_jiffies(200)); in mmc_gpio_cd_irqt()
44 int mmc_gpio_alloc(struct mmc_host *host) in mmc_gpio_alloc() argument
46 size_t len = strlen(dev_name(host->parent)) + 4; in mmc_gpio_alloc()
47 struct mmc_gpio *ctx = devm_kzalloc(host->parent, in mmc_gpio_alloc()
52 snprintf(ctx->cd_label, len, "%s cd", dev_name(host->parent)); in mmc_gpio_alloc()
53 snprintf(ctx->ro_label, len, "%s ro", dev_name(host->parent)); in mmc_gpio_alloc()
54 host->slot.handler_priv = ctx; in mmc_gpio_alloc()
55 host->slot.cd_irq = -EINVAL; in mmc_gpio_alloc()
61 int mmc_gpio_get_ro(struct mmc_host *host) in mmc_gpio_get_ro() argument
63 struct mmc_gpio *ctx = host->slot.handler_priv; in mmc_gpio_get_ro()
70 !!(host->caps2 & MMC_CAP2_RO_ACTIVE_HIGH); in mmc_gpio_get_ro()
76 int mmc_gpio_get_cd(struct mmc_host *host) in mmc_gpio_get_cd() argument
78 struct mmc_gpio *ctx = host->slot.handler_priv; in mmc_gpio_get_cd()
85 !!(host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH); in mmc_gpio_get_cd()
101 int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio) in mmc_gpio_request_ro() argument
103 struct mmc_gpio *ctx = host->slot.handler_priv; in mmc_gpio_request_ro()
109 ret = devm_gpio_request_one(host->parent, gpio, GPIOF_DIR_IN, in mmc_gpio_request_ro()
121 void mmc_gpiod_request_cd_irq(struct mmc_host *host) in mmc_gpiod_request_cd_irq() argument
123 struct mmc_gpio *ctx = host->slot.handler_priv; in mmc_gpiod_request_cd_irq()
126 if (host->slot.cd_irq >= 0 || !ctx || !ctx->cd_gpio) in mmc_gpiod_request_cd_irq()
136 if (irq >= 0 && host->caps & MMC_CAP_NEEDS_POLL) in mmc_gpiod_request_cd_irq()
142 ret = devm_request_threaded_irq(host->parent, irq, in mmc_gpiod_request_cd_irq()
145 ctx->cd_label, host); in mmc_gpiod_request_cd_irq()
150 host->slot.cd_irq = irq; in mmc_gpiod_request_cd_irq()
153 host->caps |= MMC_CAP_NEEDS_POLL; in mmc_gpiod_request_cd_irq()
160 void mmc_gpio_set_cd_isr(struct mmc_host *host, in mmc_gpio_set_cd_isr() argument
163 struct mmc_gpio *ctx = host->slot.handler_priv; in mmc_gpio_set_cd_isr()
185 int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, in mmc_gpio_request_cd() argument
188 struct mmc_gpio *ctx = host->slot.handler_priv; in mmc_gpio_request_cd()
191 ret = devm_gpio_request_one(host->parent, gpio, GPIOF_DIR_IN, in mmc_gpio_request_cd()
230 int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, in mmc_gpiod_request_cd() argument
234 struct mmc_gpio *ctx = host->slot.handler_priv; in mmc_gpiod_request_cd()
241 desc = devm_gpiod_get_index(host->parent, con_id, idx, GPIOD_IN); in mmc_gpiod_request_cd()
276 int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, in mmc_gpiod_request_ro() argument
280 struct mmc_gpio *ctx = host->slot.handler_priv; in mmc_gpiod_request_ro()
287 desc = devm_gpiod_get_index(host->parent, con_id, idx, GPIOD_IN); in mmc_gpiod_request_ro()