Lines Matching +full:num +full:- +full:irqs

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2022-2023 Cirrus Logic, Inc. and
13 #include <linux/mfd/cs42l43-regs.h>
25 .num = port, \
63 struct sdw_slave_prop *prop = &sdw->prop; in cs42l43_read_prop()
64 struct device *dev = &sdw->dev; in cs42l43_read_prop()
67 prop->use_domain_irq = true; in cs42l43_read_prop()
68 prop->paging_support = true; in cs42l43_read_prop()
69 prop->wake_capable = true; in cs42l43_read_prop()
70 prop->quirks = SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY; in cs42l43_read_prop()
71 prop->scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY | in cs42l43_read_prop()
75 prop->source_ports |= BIT(cs42l43_src_port_props[i].num); in cs42l43_read_prop()
77 prop->src_dpn_prop = devm_kmemdup(dev, cs42l43_src_port_props, in cs42l43_read_prop()
79 if (!prop->src_dpn_prop) in cs42l43_read_prop()
80 return -ENOMEM; in cs42l43_read_prop()
83 prop->sink_ports |= BIT(cs42l43_sink_port_props[i].num); in cs42l43_read_prop()
85 prop->sink_dpn_prop = devm_kmemdup(dev, cs42l43_sink_port_props, in cs42l43_read_prop()
87 if (!prop->sink_dpn_prop) in cs42l43_read_prop()
88 return -ENOMEM; in cs42l43_read_prop()
95 struct cs42l43 *cs42l43 = dev_get_drvdata(&sdw->dev); in cs42l43_sdw_update_status()
99 dev_dbg(cs42l43->dev, "Device attach\n"); in cs42l43_sdw_update_status()
104 cs42l43->attached = true; in cs42l43_sdw_update_status()
106 complete(&cs42l43->device_attach); in cs42l43_sdw_update_status()
109 dev_dbg(cs42l43->dev, "Device detach\n"); in cs42l43_sdw_update_status()
111 cs42l43->attached = false; in cs42l43_sdw_update_status()
113 reinit_completion(&cs42l43->device_attach); in cs42l43_sdw_update_status()
114 complete(&cs42l43->device_detach); in cs42l43_sdw_update_status()
131 * IRQs are still pending so doing a read/write here after handling the in cs42l43_sdw_interrupt()
143 struct cs42l43 *cs42l43 = dev_get_drvdata(&sdw->dev); in cs42l43_sdw_bus_config()
146 mutex_lock(&cs42l43->pll_lock); in cs42l43_sdw_bus_config()
148 if (cs42l43->sdw_freq != params->curr_dr_freq / 2) { in cs42l43_sdw_bus_config()
149 if (cs42l43->sdw_pll_active) { in cs42l43_sdw_bus_config()
150 dev_err(cs42l43->dev, in cs42l43_sdw_bus_config()
152 ret = -EBUSY; in cs42l43_sdw_bus_config()
154 cs42l43->sdw_freq = params->curr_dr_freq / 2; in cs42l43_sdw_bus_config()
158 mutex_unlock(&cs42l43->pll_lock); in cs42l43_sdw_bus_config()
173 struct device *dev = &sdw->dev; in cs42l43_sdw_probe()
177 return -ENOMEM; in cs42l43_sdw_probe()
179 cs42l43->dev = dev; in cs42l43_sdw_probe()
180 cs42l43->sdw = sdw; in cs42l43_sdw_probe()
182 cs42l43->regmap = devm_regmap_init_sdw(sdw, &cs42l43_sdw_regmap); in cs42l43_sdw_probe()
183 if (IS_ERR(cs42l43->regmap)) in cs42l43_sdw_probe()
184 return dev_err_probe(cs42l43->dev, PTR_ERR(cs42l43->regmap), in cs42l43_sdw_probe()