Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4d54f2a authored by Chaoli Zhou's avatar Chaoli Zhou Committed by Madan Koyyalamudi
Browse files

qcacmn: vendor interface for GPIO Configuration

Add gpio configuration vendor interface to set target
gpio configuration and output info, meanwhile add
GPIO component id

Change-Id: I0b551cd63b61675406fe37549f2efeca1a2999bf
parent d133c516
Loading
Loading
Loading
Loading
+108 −6
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -6638,19 +6638,54 @@ enum qca_wlan_vendor_acs_select_reason {

/**
 * enum qca_wlan_gpio_attr - Parameters for GPIO configuration
 *
 * @QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_COMMAND: Required (u32)
 * value to specify the gpio command, please refer to enum qca_gpio_cmd_type
 * to get the available value that this item can use.
 *
 * @QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_PINNUM: Required (u32)
 * value to specify the gpio number.
 * This is required, when %QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_COMMAND is
 * %QCA_WLAN_VENDOR_GPIO_CONFIG or %.QCA_WLAN_VENDOR_GPIO_OUTPUT.
 *
 * @QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_VALUE: Required (u32)
 * value to specify the gpio output level, please refer to enum qca_gpio_value
 * to get the available value that this item can use.
 * This is required, when %QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_COMMAND is
 * %QCA_WLAN_VENDOR_GPIO_OUTPUT.
 *
 * @QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_PULL_TYPE: Required (u32)
 * value to specify the gpio pull type, please refer to enum qca_gpio_pull_type
 * to get the available value that this item can use.
 * This is required, when %QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_COMMAND is
 * %QCA_WLAN_VENDOR_GPIO_CONFIG.
 *
 * @QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_INTR_MODE: Required (u32)
 * value to specify the gpio interrupt mode, please refer to enum
 * qca_gpio_interrupt_mode to get the available value that this item can use.
 * This is required, when %QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_COMMAND is
 * %QCA_WLAN_VENDOR_GPIO_CONFIG.
 *
 * @QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_DIR: Required (u32)
 * value to specify the gpio direction, please refer to enum qca_gpio_direction
 * to get the available value that this item can use.
 * This is required, when %QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_COMMAND is
 * %QCA_WLAN_VENDOR_GPIO_CONFIG.
 */
enum qca_wlan_gpio_attr {
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_INVALID = 0,
	/* Unsigned 32-bit attribute for GPIO command */
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_COMMAND,
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_COMMAND = 1,
	/* Unsigned 32-bit attribute for GPIO PIN number to configure */
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_PINNUM,
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_PINNUM = 2,
	/* Unsigned 32-bit attribute for GPIO value to configure */
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_VALUE,
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_VALUE = 3,
	/* Unsigned 32-bit attribute for GPIO pull type */
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_PULL_TYPE,
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_PULL_TYPE = 4,
	/* Unsigned 32-bit attribute for GPIO interrupt mode */
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_INTR_MODE,
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_INTR_MODE = 5,
	/* Unsigned 32-bit attribute for GPIO direction to configure */
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_DIR = 6,

	/* keep last */
	QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_LAST,
@@ -6658,6 +6693,73 @@ enum qca_wlan_gpio_attr {
		QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_LAST - 1,
};

/**
 * enum gpio_cmd_type - GPIO configuration command type
 * @QCA_WLAN_VENDOR_GPIO_CONFIG: set gpio configuration info
 * @QCA_WLAN_VENDOR_GPIO_OUTPUT: set gpio output level
 */
enum qca_gpio_cmd_type {
	QCA_WLAN_VENDOR_GPIO_CONFIG = 0,
	QCA_WLAN_VENDOR_GPIO_OUTPUT = 1,
};

/**
 * enum qca_gpio_pull_type - GPIO pull type
 * @QCA_WLAN_GPIO_PULL_NONE: set gpio pull type to none
 * @QCA_WLAN_GPIO_PULL_UP: set gpio pull up
 * @QCA_WLAN_GPIO_PULL_DOWN: set gpio pull down
 */
enum qca_gpio_pull_type {
	QCA_WLAN_GPIO_PULL_NONE = 0,
	QCA_WLAN_GPIO_PULL_UP = 1,
	QCA_WLAN_GPIO_PULL_DOWN = 2,
	QCA_WLAN_GPIO_PULL_MAX,
};

/**
 * enum qca_gpio_direction - GPIO direction
 * @QCA_WLAN_GPIO_INPUT: set gpio as input mode
 * @QCA_WLAN_GPIO_OUTPUT: set gpio as output mode
 * @QCA_WLAN_GPIO_VALUE_MAX: invalid value
 */
enum qca_gpio_direction {
	QCA_WLAN_GPIO_INPUT = 0,
	QCA_WLAN_GPIO_OUTPUT = 1,
	QCA_WLAN_GPIO_DIR_MAX,
};

/**
 * enum qca_gpio_value - GPIO Value
 * @QCA_WLAN_GPIO_LEVEL_LOW: set gpio output level to low
 * @QCA_WLAN_GPIO_LEVEL_HIGH: set gpio output level to high
 * @QCA_WLAN_GPIO_LEVEL_MAX: invalid value
 */
enum qca_gpio_value {
	QCA_WLAN_GPIO_LEVEL_LOW = 0,
	QCA_WLAN_GPIO_LEVEL_HIGH = 1,
	QCA_WLAN_GPIO_LEVEL_MAX,
};

/**
 * enum gpio_interrupt_mode - GPIO interrupt mode
 * @QCA_WLAN_GPIO_INTMODE_DISABLE: disable interrupt trigger
 * @QCA_WLAN_GPIO_INTMODE_RISING_EDGE: interrupt with gpio rising edge trigger
 * @QCA_WLAN_GPIO_INTMODE_FALLING_EDGE: interrupt with gpio falling edge trigger
 * @QCA_WLAN_GPIO_INTMODE_BOTH_EDGE: interrupt with gpio both edge trigger
 * @QCA_WLAN_GPIO_INTMODE_LEVEL_LOW: interrupt with gpio level low trigger
 * @QCA_WLAN_GPIO_INTMODE_LEVEL_HIGH: interrupt with gpio level high trigger
 * @QCA_WLAN_GPIO_INTMODE_MAX: invalid value
 */
enum qca_gpio_interrupt_mode {
	QCA_WLAN_GPIO_INTMODE_DISABLE = 0,
	QCA_WLAN_GPIO_INTMODE_RISING_EDGE = 1,
	QCA_WLAN_GPIO_INTMODE_FALLING_EDGE = 2,
	QCA_WLAN_GPIO_INTMODE_BOTH_EDGE = 3,
	QCA_WLAN_GPIO_INTMODE_LEVEL_LOW = 4,
	QCA_WLAN_GPIO_INTMODE_LEVEL_HIGH = 5,
	QCA_WLAN_GPIO_INTMODE_MAX,
};

/**
 * qca_wlan_set_qdepth_thresh_attr - Parameters for setting
 * MSDUQ depth threshold per peer per tid in the target
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -277,6 +277,7 @@
 * @WLAN_UMAC_COMP_COEX:          Coex config component
 * @WLAN_UMAC_COMP_FTM_TIME_SYNC: WLAN FTM TIMESYNC
 * @WLAN_UMAC_COMP_PKT_CAPTURE:   Packet capture component
 * @WLAN_UMAC_COMP_GPIO:          GPIO Configuration
 * @WLAN_UMAC_COMP_ID_MAX:        Maximum components in UMAC
 *
 * This id is static.
@@ -319,6 +320,7 @@ enum wlan_umac_comp_id {
	WLAN_UMAC_COMP_COEX               = 33,
	WLAN_UMAC_COMP_FTM_TIME_SYNC      = 34,
	WLAN_UMAC_COMP_PKT_CAPTURE        = 35,
	WLAN_UMAC_COMP_GPIO               = 39,
	WLAN_UMAC_COMP_ID_MAX,
};