Lines Matching refs:unit
316 int sm501_unit_power(struct device *dev, unsigned int unit, unsigned int to) in sm501_unit_power() argument
331 if (unit >= ARRAY_SIZE(sm->unit_power)) { in sm501_unit_power()
332 dev_err(dev, "%s: bad unit %d\n", __func__, unit); in sm501_unit_power()
336 dev_dbg(sm->dev, "%s: unit %d, cur %d, to %d\n", __func__, unit, in sm501_unit_power()
337 sm->unit_power[unit], to); in sm501_unit_power()
339 if (to == 0 && sm->unit_power[unit] == 0) { in sm501_unit_power()
340 dev_err(sm->dev, "unit %d is already shutdown\n", unit); in sm501_unit_power()
344 sm->unit_power[unit] += to ? 1 : -1; in sm501_unit_power()
345 to = sm->unit_power[unit] ? 1 : 0; in sm501_unit_power()
348 if (gate & (1 << unit)) in sm501_unit_power()
350 gate |= (1 << unit); in sm501_unit_power()
352 if (!(gate & (1 << unit))) in sm501_unit_power()
354 gate &= ~(1 << unit); in sm501_unit_power()