Loading drivers/acpi/utils.c +34 −7 Original line number Original line Diff line number Diff line Loading @@ -737,16 +737,17 @@ bool acpi_dev_found(const char *hid) } } EXPORT_SYMBOL(acpi_dev_found); EXPORT_SYMBOL(acpi_dev_found); struct acpi_dev_present_info { struct acpi_dev_match_info { const char *dev_name; struct acpi_device_id hid[2]; struct acpi_device_id hid[2]; const char *uid; const char *uid; s64 hrv; s64 hrv; }; }; static int acpi_dev_present_cb(struct device *dev, void *data) static int acpi_dev_match_cb(struct device *dev, void *data) { { struct acpi_device *adev = to_acpi_device(dev); struct acpi_device *adev = to_acpi_device(dev); struct acpi_dev_present_info *match = data; struct acpi_dev_match_info *match = data; unsigned long long hrv; unsigned long long hrv; acpi_status status; acpi_status status; Loading @@ -757,6 +758,8 @@ static int acpi_dev_present_cb(struct device *dev, void *data) strcmp(adev->pnp.unique_id, match->uid))) strcmp(adev->pnp.unique_id, match->uid))) return 0; return 0; match->dev_name = acpi_dev_name(adev); if (match->hrv == -1) if (match->hrv == -1) return 1; return 1; Loading Loading @@ -789,20 +792,44 @@ static int acpi_dev_present_cb(struct device *dev, void *data) */ */ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) { { struct acpi_dev_present_info match = {}; struct acpi_dev_match_info match = {}; struct device *dev; struct device *dev; strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); match.uid = uid; match.uid = uid; match.hrv = hrv; match.hrv = hrv; dev = bus_find_device(&acpi_bus_type, NULL, &match, dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); acpi_dev_present_cb); return !!dev; return !!dev; } } EXPORT_SYMBOL(acpi_dev_present); EXPORT_SYMBOL(acpi_dev_present); /** * acpi_dev_get_first_match_name - Return name of first match of ACPI device * @hid: Hardware ID of the device. * @uid: Unique ID of the device, pass NULL to not check _UID * @hrv: Hardware Revision of the device, pass -1 to not check _HRV * * Return device name if a matching device was present * at the moment of invocation, or NULL otherwise. * * See additional information in acpi_dev_present() as well. */ const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) { struct acpi_dev_match_info match = {}; struct device *dev; strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); match.uid = uid; match.hrv = hrv; dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); return dev ? match.dev_name : NULL; } EXPORT_SYMBOL(acpi_dev_get_first_match_name); /* /* * acpi_backlight= handling, this is done here rather then in video_detect.c * acpi_backlight= handling, this is done here rather then in video_detect.c * because __setup cannot be used in modules. * because __setup cannot be used in modules. Loading drivers/gpio/gpio-merrifield.c +10 −1 Original line number Original line Diff line number Diff line Loading @@ -9,6 +9,7 @@ * published by the Free Software Foundation. * published by the Free Software Foundation. */ */ #include <linux/acpi.h> #include <linux/bitops.h> #include <linux/bitops.h> #include <linux/gpio/driver.h> #include <linux/gpio/driver.h> #include <linux/init.h> #include <linux/init.h> Loading Loading @@ -380,9 +381,16 @@ static void mrfld_irq_init_hw(struct mrfld_gpio *priv) } } } } static const char *mrfld_gpio_get_pinctrl_dev_name(void) { const char *dev_name = acpi_dev_get_first_match_name("INTC1002", NULL, -1); return dev_name ? dev_name : "pinctrl-merrifield"; } static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id) static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id) { { const struct mrfld_gpio_pinrange *range; const struct mrfld_gpio_pinrange *range; const char *pinctrl_dev_name; struct mrfld_gpio *priv; struct mrfld_gpio *priv; u32 gpio_base, irq_base; u32 gpio_base, irq_base; void __iomem *base; void __iomem *base; Loading Loading @@ -439,10 +447,11 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id return retval; return retval; } } pinctrl_dev_name = mrfld_gpio_get_pinctrl_dev_name(); for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) { for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) { range = &mrfld_gpio_ranges[i]; range = &mrfld_gpio_ranges[i]; retval = gpiochip_add_pin_range(&priv->chip, retval = gpiochip_add_pin_range(&priv->chip, "pinctrl-merrifield", pinctrl_dev_name, range->gpio_base, range->gpio_base, range->pin_base, range->pin_base, range->npins); range->npins); Loading include/acpi/acpi_bus.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -91,6 +91,9 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, bool acpi_dev_found(const char *hid); bool acpi_dev_found(const char *hid); bool acpi_dev_present(const char *hid, const char *uid, s64 hrv); bool acpi_dev_present(const char *hid, const char *uid, s64 hrv); const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv); #ifdef CONFIG_ACPI #ifdef CONFIG_ACPI #include <linux/proc_fs.h> #include <linux/proc_fs.h> Loading include/linux/acpi.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -640,6 +640,12 @@ static inline bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) return false; return false; } } static inline const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) { return NULL; } static inline bool is_acpi_node(struct fwnode_handle *fwnode) static inline bool is_acpi_node(struct fwnode_handle *fwnode) { { return false; return false; Loading include/sound/hdaudio_ext.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -193,7 +193,7 @@ struct hda_dai_map { * @pvt_data - private data, for asoc contains asoc codec object * @pvt_data - private data, for asoc contains asoc codec object */ */ struct hdac_ext_device { struct hdac_ext_device { struct hdac_device hdac; struct hdac_device hdev; struct hdac_ext_bus *ebus; struct hdac_ext_bus *ebus; /* soc-dai to nid map */ /* soc-dai to nid map */ Loading @@ -213,7 +213,7 @@ struct hdac_ext_dma_params { u8 stream_tag; u8 stream_tag; }; }; #define to_ehdac_device(dev) (container_of((dev), \ #define to_ehdac_device(dev) (container_of((dev), \ struct hdac_ext_device, hdac)) struct hdac_ext_device, hdev)) /* /* * HD-audio codec base driver * HD-audio codec base driver */ */ Loading Loading
drivers/acpi/utils.c +34 −7 Original line number Original line Diff line number Diff line Loading @@ -737,16 +737,17 @@ bool acpi_dev_found(const char *hid) } } EXPORT_SYMBOL(acpi_dev_found); EXPORT_SYMBOL(acpi_dev_found); struct acpi_dev_present_info { struct acpi_dev_match_info { const char *dev_name; struct acpi_device_id hid[2]; struct acpi_device_id hid[2]; const char *uid; const char *uid; s64 hrv; s64 hrv; }; }; static int acpi_dev_present_cb(struct device *dev, void *data) static int acpi_dev_match_cb(struct device *dev, void *data) { { struct acpi_device *adev = to_acpi_device(dev); struct acpi_device *adev = to_acpi_device(dev); struct acpi_dev_present_info *match = data; struct acpi_dev_match_info *match = data; unsigned long long hrv; unsigned long long hrv; acpi_status status; acpi_status status; Loading @@ -757,6 +758,8 @@ static int acpi_dev_present_cb(struct device *dev, void *data) strcmp(adev->pnp.unique_id, match->uid))) strcmp(adev->pnp.unique_id, match->uid))) return 0; return 0; match->dev_name = acpi_dev_name(adev); if (match->hrv == -1) if (match->hrv == -1) return 1; return 1; Loading Loading @@ -789,20 +792,44 @@ static int acpi_dev_present_cb(struct device *dev, void *data) */ */ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) { { struct acpi_dev_present_info match = {}; struct acpi_dev_match_info match = {}; struct device *dev; struct device *dev; strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); match.uid = uid; match.uid = uid; match.hrv = hrv; match.hrv = hrv; dev = bus_find_device(&acpi_bus_type, NULL, &match, dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); acpi_dev_present_cb); return !!dev; return !!dev; } } EXPORT_SYMBOL(acpi_dev_present); EXPORT_SYMBOL(acpi_dev_present); /** * acpi_dev_get_first_match_name - Return name of first match of ACPI device * @hid: Hardware ID of the device. * @uid: Unique ID of the device, pass NULL to not check _UID * @hrv: Hardware Revision of the device, pass -1 to not check _HRV * * Return device name if a matching device was present * at the moment of invocation, or NULL otherwise. * * See additional information in acpi_dev_present() as well. */ const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) { struct acpi_dev_match_info match = {}; struct device *dev; strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); match.uid = uid; match.hrv = hrv; dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); return dev ? match.dev_name : NULL; } EXPORT_SYMBOL(acpi_dev_get_first_match_name); /* /* * acpi_backlight= handling, this is done here rather then in video_detect.c * acpi_backlight= handling, this is done here rather then in video_detect.c * because __setup cannot be used in modules. * because __setup cannot be used in modules. Loading
drivers/gpio/gpio-merrifield.c +10 −1 Original line number Original line Diff line number Diff line Loading @@ -9,6 +9,7 @@ * published by the Free Software Foundation. * published by the Free Software Foundation. */ */ #include <linux/acpi.h> #include <linux/bitops.h> #include <linux/bitops.h> #include <linux/gpio/driver.h> #include <linux/gpio/driver.h> #include <linux/init.h> #include <linux/init.h> Loading Loading @@ -380,9 +381,16 @@ static void mrfld_irq_init_hw(struct mrfld_gpio *priv) } } } } static const char *mrfld_gpio_get_pinctrl_dev_name(void) { const char *dev_name = acpi_dev_get_first_match_name("INTC1002", NULL, -1); return dev_name ? dev_name : "pinctrl-merrifield"; } static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id) static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id) { { const struct mrfld_gpio_pinrange *range; const struct mrfld_gpio_pinrange *range; const char *pinctrl_dev_name; struct mrfld_gpio *priv; struct mrfld_gpio *priv; u32 gpio_base, irq_base; u32 gpio_base, irq_base; void __iomem *base; void __iomem *base; Loading Loading @@ -439,10 +447,11 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id return retval; return retval; } } pinctrl_dev_name = mrfld_gpio_get_pinctrl_dev_name(); for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) { for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) { range = &mrfld_gpio_ranges[i]; range = &mrfld_gpio_ranges[i]; retval = gpiochip_add_pin_range(&priv->chip, retval = gpiochip_add_pin_range(&priv->chip, "pinctrl-merrifield", pinctrl_dev_name, range->gpio_base, range->gpio_base, range->pin_base, range->pin_base, range->npins); range->npins); Loading
include/acpi/acpi_bus.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -91,6 +91,9 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, bool acpi_dev_found(const char *hid); bool acpi_dev_found(const char *hid); bool acpi_dev_present(const char *hid, const char *uid, s64 hrv); bool acpi_dev_present(const char *hid, const char *uid, s64 hrv); const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv); #ifdef CONFIG_ACPI #ifdef CONFIG_ACPI #include <linux/proc_fs.h> #include <linux/proc_fs.h> Loading
include/linux/acpi.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -640,6 +640,12 @@ static inline bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) return false; return false; } } static inline const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) { return NULL; } static inline bool is_acpi_node(struct fwnode_handle *fwnode) static inline bool is_acpi_node(struct fwnode_handle *fwnode) { { return false; return false; Loading
include/sound/hdaudio_ext.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -193,7 +193,7 @@ struct hda_dai_map { * @pvt_data - private data, for asoc contains asoc codec object * @pvt_data - private data, for asoc contains asoc codec object */ */ struct hdac_ext_device { struct hdac_ext_device { struct hdac_device hdac; struct hdac_device hdev; struct hdac_ext_bus *ebus; struct hdac_ext_bus *ebus; /* soc-dai to nid map */ /* soc-dai to nid map */ Loading @@ -213,7 +213,7 @@ struct hdac_ext_dma_params { u8 stream_tag; u8 stream_tag; }; }; #define to_ehdac_device(dev) (container_of((dev), \ #define to_ehdac_device(dev) (container_of((dev), \ struct hdac_ext_device, hdac)) struct hdac_ext_device, hdev)) /* /* * HD-audio codec base driver * HD-audio codec base driver */ */ Loading