host-drivers/base-driver/vca/plx87xx/plx_hw.c
void plx_card_press_power_button(struct plx_device *xdev,
		struct completion *compl, int cpu_id, bool hold,
		struct completion *wait_start)
{
	if (xdev->card_type & VCA_MV) {
		u32 bit = 0;
		if (cpu_id < 0 || cpu_id >= plx_get_cpu_num(xdev)) {
			if (wait_start)
				complete_all(wait_start);
			dev_err(&xdev->pdev->dev, "Unknown CPU ID: card %d cpu %d\n",
					xdev->card_id, cpu_id);
			return;
		}
		bit = plx_power_button_bits[cpu_id];

		dev_dbg(&xdev->pdev->dev, "Power OFF %s begin: card %d cpu %d\n",
				hold?"hold":"toggle",xdev->card_id, cpu_id);
		if (hold) {
			signal_bit(xdev, compl, bit, GPIO_REG, POWER_OFF_HOLD_TIME, wait_start, &xdev->power_ts[cpu_id]);
		} else {
			signal_bit(xdev, compl, bit, GPIO_REG, POWER_OFF_PULSE_TIME, wait_start, &xdev->power_ts[cpu_id]);
		}

		dev_dbg(&xdev->pdev->dev, "Power OFF %s end: card %d cpu %d\n",
				hold?"hold":"toggle",xdev->card_id, cpu_id);

	} else {
		if (wait_start)
			complete_all(wait_start);

		if (!(xdev->card_type & VCA_VV)) {
			/* Ignore power button for VV cards, display error for others */
			dev_err(&xdev->pdev->dev, "Power unsupported: card %d cpu %d\n", xdev->card_id, cpu_id);
		}
	}
}
/*
 * plx_card_press_power_button - Manages power button on VCA device.
 * @xdev: pointer to plx_device instance
 * @compl: for signal_bit to complete on driver unload
 * @cpu_id: id of cpu to reset
 * @hold: true to set power button hold, false to set power button toggle
 * @wait_start: completion to trigger moment when button state start change
 */
Manages power button on VCA device.
Manages power button on VCA device .
void plx_card_press_power_button(struct plx_device *xdev,
		struct completion *compl, int cpu_id, bool hold,
		struct completion *wait_start)
{
	if (xdev->card_type & VCA_MV) {
		u32 bit = 0;
		if (cpu_id < 0 || cpu_id >= plx_get_cpu_num(xdev)) {
			if (wait_start)
				complete_all(wait_start);
			dev_err(&xdev->pdev->dev, "Unknown CPU ID: card %d cpu %d\n",
					xdev->card_id, cpu_id);
			return;
		}
		bit = plx_power_button_bits[cpu_id];
		dev_dbg(&xdev->pdev->dev, "Power OFF %s begin: card %d cpu %d\n",
				hold?"hold":"toggle",xdev->card_id, cpu_id);
		if (hold) {
			signal_bit(xdev, compl, bit, GPIO_REG, POWER_OFF_HOLD_TIME, wait_start, &xdev->power_ts[cpu_id]);
		} else {
			signal_bit(xdev, compl, bit, GPIO_REG, POWER_OFF_PULSE_TIME, wait_start, &xdev->power_ts[cpu_id]);
		}
		dev_dbg(&xdev->pdev->dev, "Power OFF %s end: card %d cpu %d\n",
				hold?"hold":"toggle",xdev->card_id, cpu_id);
	} else {
		if (wait_start)
			complete_all(wait_start);
		if (!(xdev->card_type & VCA_VV)) {
			dev_err(&xdev->pdev->dev, "Power unsupported: card %d cpu %d\n", xdev->card_id, cpu_id);
		}
	}
}
void plx_card_press_power_button ( struct plx_device * xdev , struct completion * compl , int cpu_id , bool hold , struct completion * wait_start ) { if ( xdev -> card_type & VCA_MV ) { u32 bit = 0 ; if ( cpu_id < 0 || cpu_id >= plx_get_cpu_num ( xdev ) ) { if ( wait_start ) complete_all ( wait_start ) ; dev_err ( & xdev -> pdev -> dev , " \n " , xdev -> card_id , cpu_id ) ; return ; } bit = plx_power_button_bits [ cpu_id ] ; dev_dbg ( & xdev -> pdev -> dev , " \n " , hold ? " " : " " , xdev -> card_id , cpu_id ) ; if ( hold ) { signal_bit ( xdev , compl , bit , GPIO_REG , POWER_OFF_HOLD_TIME , wait_start , & xdev -> power_ts [ cpu_id ] ) ; } else { signal_bit ( xdev , compl , bit , GPIO_REG , POWER_OFF_PULSE_TIME , wait_start , & xdev -> power_ts [ cpu_id ] ) ; } dev_dbg ( & xdev -> pdev -> dev , " \n " , hold ? " " : " " , xdev -> card_id , cpu_id ) ; } else { if ( wait_start ) complete_all ( wait_start ) ; if ( ! ( xdev -> card_type & VCA_VV ) ) { dev_err ( & xdev -> pdev -> dev , " \n " , xdev -> card_id , cpu_id ) ; } } }
plx_card_press_power_button - Manages power button on VCA device.
plx_card_press_power_button - Manages power button on VCA device .
/* Ignore power button for VV cards, display error for others */