summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/intel_vsec.h39
-rw-r--r--include/linux/platform_data/x86/int3472.h12
-rw-r--r--include/linux/wmi.h15
3 files changed, 48 insertions, 18 deletions
diff --git a/include/linux/intel_vsec.h b/include/linux/intel_vsec.h
index 1a0f357c2427..1fe5665a9d02 100644
--- a/include/linux/intel_vsec.h
+++ b/include/linux/intel_vsec.h
@@ -29,9 +29,15 @@
#define INTEL_DVSEC_TABLE_OFFSET(x) ((x) & GENMASK(31, 3))
#define TABLE_OFFSET_SHIFT 3
+struct device;
struct pci_dev;
struct resource;
+enum intel_vsec_disc_source {
+ INTEL_VSEC_DISC_PCI, /* PCI, default */
+ INTEL_VSEC_DISC_ACPI, /* ACPI */
+};
+
enum intel_vsec_id {
VSEC_ID_TELEMETRY = 2,
VSEC_ID_WATCHER = 3,
@@ -82,14 +88,14 @@ enum intel_vsec_quirks {
* struct pmt_callbacks - Callback infrastructure for PMT devices
* @read_telem: when specified, called by client driver to access PMT
* data (instead of direct copy).
- * * pdev: PCI device reference for the callback's use
+ * * dev: device reference for the callback's use
* * guid: ID of data to acccss
* * data: buffer for the data to be copied
* * off: offset into the requested buffer
* * count: size of buffer
*/
struct pmt_callbacks {
- int (*read_telem)(struct pci_dev *pdev, u32 guid, u64 *data, loff_t off, u32 count);
+ int (*read_telem)(struct device *dev, u32 guid, u64 *data, loff_t off, u32 count);
};
struct vsec_feature_dependency {
@@ -102,6 +108,10 @@ struct vsec_feature_dependency {
* @parent: parent device in the auxbus chain
* @headers: list of headers to define the PMT client devices to create
* @deps: array of feature dependencies
+ * @acpi_disc: ACPI discovery tables, each entry is two QWORDs
+ * in little-endian format as defined by the PMT ACPI spec.
+ * Valid only when @provider == INTEL_VSEC_DISC_ACPI.
+ * @src: source of discovery table data
* @priv_data: private data, usable by parent devices, currently a callback
* @caps: bitmask of PMT capabilities for the given headers
* @quirks: bitmask of VSEC device quirks
@@ -112,6 +122,8 @@ struct intel_vsec_platform_info {
struct device *parent;
struct intel_vsec_header **headers;
const struct vsec_feature_dependency *deps;
+ u32 (*acpi_disc)[4];
+ enum intel_vsec_disc_source src;
void *priv_data;
unsigned long caps;
unsigned long quirks;
@@ -122,8 +134,13 @@ struct intel_vsec_platform_info {
/**
* struct intel_vsec_device - Auxbus specific device information
* @auxdev: auxbus device struct for auxbus access
- * @pcidev: pci device associated with the device
- * @resource: any resources shared by the parent
+ * @dev: struct device associated with the device
+ * @resource: PCI discovery resources (BAR windows), one per discovery
+ * instance. Valid only when @src == INTEL_VSEC_DISC_PCI
+ * @acpi_disc: ACPI discovery tables, each entry is two QWORDs
+ * in little-endian format as defined by the PMT ACPI spec.
+ * Valid only when @src == INTEL_VSEC_DISC_ACPI.
+ * @src: source of discovery table data
* @ida: id reference
* @num_resources: number of resources
* @id: xarray id
@@ -135,8 +152,10 @@ struct intel_vsec_platform_info {
*/
struct intel_vsec_device {
struct auxiliary_device auxdev;
- struct pci_dev *pcidev;
+ struct device *dev;
struct resource *resource;
+ u32 (*acpi_disc)[4];
+ enum intel_vsec_disc_source src;
struct ida *ida;
int num_resources;
int id; /* xa */
@@ -184,7 +203,7 @@ struct pmt_feature_group {
struct telemetry_region regions[];
};
-int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
+int intel_vsec_add_aux(struct device *parent,
struct intel_vsec_device *intel_vsec_dev,
const char *name);
@@ -199,14 +218,14 @@ static inline struct intel_vsec_device *auxdev_to_ivdev(struct auxiliary_device
}
#if IS_ENABLED(CONFIG_INTEL_VSEC)
-int intel_vsec_register(struct pci_dev *pdev,
- struct intel_vsec_platform_info *info);
+int intel_vsec_register(struct device *dev,
+ const struct intel_vsec_platform_info *info);
int intel_vsec_set_mapping(struct oobmsm_plat_info *plat_info,
struct intel_vsec_device *vsec_dev);
struct oobmsm_plat_info *intel_vsec_get_mapping(struct pci_dev *pdev);
#else
-static inline int intel_vsec_register(struct pci_dev *pdev,
- struct intel_vsec_platform_info *info)
+static inline int intel_vsec_register(struct device *dev,
+ const struct intel_vsec_platform_info *info)
{
return -ENODEV;
}
diff --git a/include/linux/platform_data/x86/int3472.h b/include/linux/platform_data/x86/int3472.h
index dbe745dc88d5..93f1e1fe09b4 100644
--- a/include/linux/platform_data/x86/int3472.h
+++ b/include/linux/platform_data/x86/int3472.h
@@ -23,6 +23,7 @@
/* PMIC GPIO Types */
#define INT3472_GPIO_TYPE_RESET 0x00
#define INT3472_GPIO_TYPE_POWERDOWN 0x01
+#define INT3472_GPIO_TYPE_STROBE 0x02
#define INT3472_GPIO_TYPE_POWER_ENABLE 0x0b
#define INT3472_GPIO_TYPE_CLK_ENABLE 0x0c
#define INT3472_GPIO_TYPE_PRIVACY_LED 0x0d
@@ -32,6 +33,7 @@
#define INT3472_PDEV_MAX_NAME_LEN 23
#define INT3472_MAX_SENSOR_GPIOS 3
+#define INT3472_MAX_LEDS 2
#define INT3472_MAX_REGULATORS 3
/* E.g. "dovdd\0" */
@@ -122,16 +124,17 @@ struct int3472_discrete_device {
u8 imgclk_index;
} clock;
- struct int3472_pled {
+ struct int3472_led {
struct led_classdev classdev;
struct led_lookup_data lookup;
char name[INT3472_LED_MAX_NAME_LEN];
struct gpio_desc *gpio;
- } pled;
+ } leds[INT3472_MAX_LEDS];
struct int3472_discrete_quirks quirks;
unsigned int ngpios; /* how many GPIOs have we seen */
+ unsigned int n_leds; /* how many LEDs have we registered */
unsigned int n_sensor_gpios; /* how many have we mapped to sensor */
unsigned int n_regulator_gpios; /* how many have we mapped to a regulator */
struct gpiod_lookup_table gpios;
@@ -161,7 +164,8 @@ int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
const char *second_sensor);
void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472);
-int skl_int3472_register_pled(struct int3472_discrete_device *int3472, struct gpio_desc *gpio);
-void skl_int3472_unregister_pled(struct int3472_discrete_device *int3472);
+int skl_int3472_register_led(struct int3472_discrete_device *int3472, struct gpio_desc *gpio,
+ const char *con_id);
+void skl_int3472_unregister_leds(struct int3472_discrete_device *int3472);
#endif
diff --git a/include/linux/wmi.h b/include/linux/wmi.h
index 14fb644e1701..d723e4b1cafb 100644
--- a/include/linux/wmi.h
+++ b/include/linux/wmi.h
@@ -64,9 +64,13 @@ ssize_t wmi_string_from_utf8s(struct wmi_string *str, size_t max_chars, const u8
size_t src_length);
int wmidev_invoke_method(struct wmi_device *wdev, u8 instance, u32 method_id,
- const struct wmi_buffer *in, struct wmi_buffer *out);
+ const struct wmi_buffer *in, struct wmi_buffer *out, size_t min_size);
-int wmidev_query_block(struct wmi_device *wdev, u8 instance, struct wmi_buffer *out);
+int wmidev_invoke_procedure(struct wmi_device *wdev, u8 instance, u32 method_id,
+ const struct wmi_buffer *in);
+
+int wmidev_query_block(struct wmi_device *wdev, u8 instance, struct wmi_buffer *out,
+ size_t min_size);
int wmidev_set_block(struct wmi_device *wdev, u8 instance, const struct wmi_buffer *in);
@@ -83,7 +87,7 @@ u8 wmidev_instance_count(struct wmi_device *wdev);
* struct wmi_driver - WMI driver structure
* @driver: Driver model structure
* @id_table: List of WMI GUIDs supported by this driver
- * @no_notify_data: Driver supports WMI events which provide no event data
+ * @min_event_size: Minimum event payload size supported by this driver
* @no_singleton: Driver can be instantiated multiple times
* @probe: Callback for device binding
* @remove: Callback for device unbinding
@@ -93,11 +97,14 @@ u8 wmidev_instance_count(struct wmi_device *wdev);
*
* This represents WMI drivers which handle WMI devices. The data inside the buffer
* passed to the @notify_new callback is guaranteed to be aligned on a 8-byte boundary.
+ * The minimum supported size for said buffer can be specified using @min_event_size.
+ * WMI drivers that still use the deprecated @notify callback can still set @min_event_size
+ * to 0 in order to signal that they support WMI events which provide no event data.
*/
struct wmi_driver {
struct device_driver driver;
const struct wmi_device_id *id_table;
- bool no_notify_data;
+ size_t min_event_size;
bool no_singleton;
int (*probe)(struct wmi_device *wdev, const void *context);