Merge branches 'acpica', 'acpi-video' and 'device-properties'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 4 Dec 2015 13:01:17 +0000 (14:01 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 4 Dec 2015 13:01:17 +0000 (14:01 +0100)
* acpica:
  ACPI: Better describe ACPI_DEBUGGER

* acpi-video:
  MAINTAINERS: ACPI / video: update a file name in drivers/acpi/

* device-properties:
  ACPI / property: fix compile error for acpi_node_get_property_reference() when CONFIG_ACPI=n

1  2  3  4 
drivers/acpi/Kconfig
include/linux/acpi.h

diff --combined drivers/acpi/Kconfig
@@@@@ -57,15 -57,15 -57,15 -57,6 +57,15 @@@@@ config ACPI_SYSTEM_POWER_STATES_SUPPOR
    config ACPI_CCA_REQUIRED
        bool
    
- -     bool "In-kernel debugger (EXPERIMENTAL)"
   +config ACPI_DEBUGGER
- -       Enable in-kernel debugging facilities: statistics, internal
+ ++    bool "AML debugger interface (EXPERIMENTAL)"
   +    select ACPI_DEBUG
   +    help
+ ++      Enable in-kernel debugging of AML facilities: statistics, internal
   +      object dump, single step control method execution.
   +      This is still under development, currently enabling this only
   +      results in the compilation of the ACPICA debugger files.
   +
    config ACPI_SLEEP
        bool
        depends on SUSPEND || HIBERNATION
@@@@@ -206,25 -206,11 -206,25 -197,11 +206,25 @@@@@ config ACPI_PROCESSOR_IDL
        bool
        select CPU_IDLE
    
 + +config ACPI_CPPC_LIB
 + +    bool
 + +    depends on ACPI_PROCESSOR
 + +    depends on !ACPI_CPU_FREQ_PSS
 + +    select MAILBOX
 + +    select PCC
 + +    help
 + +      If this option is enabled, this file implements common functionality
 + +      to parse CPPC tables as described in the ACPI 5.1+ spec. The
 + +      routines implemented are meant to be used by other
 + +      drivers to control CPU performance using CPPC semantics.
 + +      If your platform does not support CPPC in firmware,
 + +      leave this option disabled.
 + +
    config ACPI_PROCESSOR
        tristate "Processor"
 - -    depends on X86 || IA64
 - -    select ACPI_PROCESSOR_IDLE
 - -    select ACPI_CPU_FREQ_PSS
 + +    depends on X86 || IA64 || ARM64
 + +    select ACPI_PROCESSOR_IDLE if X86 || IA64
 + +    select ACPI_CPU_FREQ_PSS if X86 || IA64
        default y
        help
          This driver adds support for the ACPI Processor package. It is required
diff --combined include/linux/acpi.h
@@@@@ -49,7 -49,7 -49,7 -49,7 +49,7 @@@@@ static inline acpi_handle acpi_device_h
        return adev ? adev->handle : NULL;
    }
    
 -  #define ACPI_COMPANION(dev)         to_acpi_node((dev)->fwnode)
 +  #define ACPI_COMPANION(dev)         to_acpi_device_node((dev)->fwnode)
    #define ACPI_COMPANION_SET(dev, adev)       set_primary_fwnode(dev, (adev) ? \
        acpi_fwnode_handle(adev) : NULL)
    #define ACPI_HANDLE(dev)            acpi_device_handle(ACPI_COMPANION(dev))
    
    static inline bool has_acpi_companion(struct device *dev)
    {
 -      return is_acpi_node(dev->fwnode);
 +      return is_acpi_device_node(dev->fwnode);
    }
    
    static inline void acpi_preset_companion(struct device *dev,
@@@@@ -131,12 -131,6 -131,12 -131,6 +131,12 @@@@@ static inline void acpi_initrd_override
                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
                ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
    
 + +struct acpi_subtable_proc {
 + +    int id;
 + +    acpi_tbl_entry_handler handler;
 + +    int count;
 + +};
 + +
    char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
    void __acpi_unmap_table(char *map, unsigned long size);
    int early_acpi_boot_init(void);
@@@@@ -152,16 -146,9 -152,16 -146,9 +152,16 @@@@@ int __init acpi_parse_entries(char *id
                              struct acpi_table_header *table_header,
                              int entry_id, unsigned int max_entries);
    int __init acpi_table_parse_entries(char *id, unsigned long table_size,
 - -                                int entry_id,
 - -                                acpi_tbl_entry_handler handler,
 - -                                unsigned int max_entries);
 + +                          int entry_id,
 + +                          acpi_tbl_entry_handler handler,
 + +                          unsigned int max_entries);
 + +int __init acpi_table_parse_entries(char *id, unsigned long table_size,
 + +                          int entry_id,
 + +                          acpi_tbl_entry_handler handler,
 + +                          unsigned int max_entries);
 + +int __init acpi_table_parse_entries_array(char *id, unsigned long table_size,
 + +                          struct acpi_subtable_proc *proc, int proc_num,
 + +                          unsigned int max_entries);
    int acpi_table_parse_madt(enum acpi_madt_type id,
                          acpi_tbl_entry_handler handler,
                          unsigned int max_entries);
@@@@@ -206,12 -193,6 -206,12 -193,6 +206,12 @@@@@ int acpi_ioapic_registered(acpi_handle 
    void acpi_irq_stats_init(void);
    extern u32 acpi_irq_handled;
    extern u32 acpi_irq_not_handled;
 + +extern unsigned int acpi_sci_irq;
 + +#define INVALID_ACPI_IRQ    ((unsigned)-1)
 + +static inline bool acpi_sci_irq_valid(void)
 + +{
 + +    return acpi_sci_irq != INVALID_ACPI_IRQ;
 + +}
    
    extern int sbf_port;
    extern unsigned long acpi_realmode_flags;
@@@@@ -220,9 -201,6 -220,9 -201,6 +220,9 @@@@@ int acpi_register_gsi (struct device *d
    int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
    int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi);
    
 + +void acpi_set_irq_model(enum acpi_irq_model_id model,
 + +                    struct fwnode_handle *fwnode);
 + +
    #ifdef CONFIG_X86_IO_APIC
    extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity);
    #else
@@@@@ -239,7 -217,7 -239,7 -217,6 +239,7 @@@@@ struct pci_dev
    
    int acpi_pci_irq_enable (struct pci_dev *dev);
    void acpi_penalize_isa_irq(int irq, int active);
   +bool acpi_isa_irq_available(int irq);
    void acpi_penalize_sci_irq(int irq, int trigger, int polarity);
    void acpi_pci_irq_disable (struct pci_dev *dev);
    
@@@@@ -484,22 -462,7 -484,22 -461,22 +484,22 @@@@@ static inline bool is_acpi_node(struct 
        return false;
    }
    
 -  static inline struct acpi_device *to_acpi_node(struct fwnode_handle *fwnode)
 +  static inline bool is_acpi_device_node(struct fwnode_handle *fwnode)
 +  {
 +      return false;
 +  }
 +  
 +  static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
 +  {
 +      return NULL;
 +  }
 +  
 +  static inline bool is_acpi_data_node(struct fwnode_handle *fwnode)
 +  {
 +      return false;
 +  }
 +  
 +  static inline struct acpi_data_node *to_acpi_data_node(struct fwnode_handle *fwnode)
    {
        return NULL;
    }
@@@@@ -514,11 -477,6 -514,11 -491,6 +514,11 @@@@@ static inline bool has_acpi_companion(s
        return false;
    }
    
 + +static inline void acpi_preset_companion(struct device *dev,
 + +                                     struct acpi_device *parent, u64 addr)
 + +{
 + +}
 + +
    static inline const char *acpi_dev_name(struct acpi_device *adev)
    {
        return NULL;
@@@@@ -601,16 -559,11 -601,16 -573,11 +601,16 @@@@@ static inline int acpi_device_modalias(
        return -ENODEV;
    }
    
 - -static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent)
 + +static inline bool acpi_dma_supported(struct acpi_device *adev)
    {
        return false;
    }
    
 + +static inline enum dev_dma_attr acpi_get_dma_attr(struct acpi_device *adev)
 + +{
 + +    return DEV_DMA_NOT_SUPPORTED;
 + +}
 + +
    #define ACPI_PTR(_ptr)      (NULL)
    
    #endif      /* !CONFIG_ACPI */
@@@@@ -791,76 -744,22 -791,76 -758,21 +791,76 @@@@@ struct acpi_reference_args 
    #ifdef CONFIG_ACPI
    int acpi_dev_get_property(struct acpi_device *adev, const char *name,
                          acpi_object_type type, const union acpi_object **obj);
 -  int acpi_dev_get_property_array(struct acpi_device *adev, const char *name,
 -                              acpi_object_type type,
 -                              const union acpi_object **obj);
 -  int acpi_dev_get_property_reference(struct acpi_device *adev,
 -                                  const char *name, size_t index,
 -                                  struct acpi_reference_args *args);
 -  
 -  int acpi_dev_prop_get(struct acpi_device *adev, const char *propname,
 -                    void **valptr);
 +  int acpi_node_get_property_reference(struct fwnode_handle *fwnode,
 +                                   const char *name, size_t index,
 +                                   struct acpi_reference_args *args);
 +  
 +  int acpi_node_prop_get(struct fwnode_handle *fwnode, const char *propname,
 +                     void **valptr);
    int acpi_dev_prop_read_single(struct acpi_device *adev, const char *propname,
                              enum dev_prop_type proptype, void *val);
 +  int acpi_node_prop_read(struct fwnode_handle *fwnode, const char *propname,
 +                      enum dev_prop_type proptype, void *val, size_t nval);
    int acpi_dev_prop_read(struct acpi_device *adev, const char *propname,
                       enum dev_prop_type proptype, void *val, size_t nval);
    
 -  struct acpi_device *acpi_get_next_child(struct device *dev,
 -                                      struct acpi_device *child);
 +  struct fwnode_handle *acpi_get_next_subnode(struct device *dev,
 +                                          struct fwnode_handle *subnode);
 + +
 + +struct acpi_probe_entry;
 + +typedef bool (*acpi_probe_entry_validate_subtbl)(struct acpi_subtable_header *,
 + +                                             struct acpi_probe_entry *);
 + +
 + +#define ACPI_TABLE_ID_LEN   5
 + +
 + +/**
 + + * struct acpi_probe_entry - boot-time probing entry
 + + * @id:                     ACPI table name
 + + * @type:           Optional subtable type to match
 + + *                  (if @id contains subtables)
 + + * @subtable_valid: Optional callback to check the validity of
 + + *                  the subtable
 + + * @probe_table:    Callback to the driver being probed when table
 + + *                  match is successful
 + + * @probe_subtbl:   Callback to the driver being probed when table and
 + + *                  subtable match (and optional callback is successful)
 + + * @driver_data:    Sideband data provided back to the driver
 + + */
 + +struct acpi_probe_entry {
 + +    __u8 id[ACPI_TABLE_ID_LEN];
 + +    __u8 type;
 + +    acpi_probe_entry_validate_subtbl subtable_valid;
 + +    union {
 + +            acpi_tbl_table_handler probe_table;
 + +            acpi_tbl_entry_handler probe_subtbl;
 + +    };
 + +    kernel_ulong_t driver_data;
 + +};
 + +
 + +#define ACPI_DECLARE_PROBE_ENTRY(table, name, table_id, subtable, valid, data, fn)  \
 + +    static const struct acpi_probe_entry __acpi_probe_##name        \
 + +            __used __section(__##table##_acpi_probe_table)          \
 + +             = {                                                    \
 + +                    .id = table_id,                                 \
 + +                    .type = subtable,                               \
 + +                    .subtable_valid = valid,                        \
 + +                    .probe_table = (acpi_tbl_table_handler)fn,      \
 + +                    .driver_data = data,                            \
 + +               }
 + +
 + +#define ACPI_PROBE_TABLE(name)              __##name##_acpi_probe_table
 + +#define ACPI_PROBE_TABLE_END(name)  __##name##_acpi_probe_table_end
 + +
 + +int __acpi_probe_device_table(struct acpi_probe_entry *start, int nr);
 + +
 + +#define acpi_probe_device_table(t)                                  \
 + +    ({                                                              \
 + +            extern struct acpi_probe_entry ACPI_PROBE_TABLE(t),     \
 + +                                           ACPI_PROBE_TABLE_END(t); \
 + +            __acpi_probe_device_table(&ACPI_PROBE_TABLE(t),         \
 + +                                      (&ACPI_PROBE_TABLE_END(t) -   \
 + +                                       &ACPI_PROBE_TABLE(t)));      \
 + +    })
    #else
    static inline int acpi_dev_get_property(struct acpi_device *adev,
                                        const char *name, acpi_object_type type,
    {
        return -ENXIO;
    }
 -  static inline int acpi_dev_get_property_array(struct acpi_device *adev,
 -                                            const char *name,
 -                                            acpi_object_type type,
 -                                            const union acpi_object **obj)
 +  
 +  static inline int acpi_node_get_property_reference(struct fwnode_handle *fwnode,
- -                             const char *name, const char *cells_name,
- -                             size_t index, struct acpi_reference_args *args)
+++                             const char *name, size_t index,
+++                             struct acpi_reference_args *args)
    {
        return -ENXIO;
    }
 -  static inline int acpi_dev_get_property_reference(struct acpi_device *adev,
 -                              const char *name, const char *cells_name,
 -                              size_t index, struct acpi_reference_args *args)
 +  
 +  static inline int acpi_node_prop_get(struct fwnode_handle *fwnode,
 +                                   const char *propname,
 +                                   void **valptr)
    {
        return -ENXIO;
    }
@@@@@ -898,14 -796,6 -898,14 -810,14 +898,14 @@@@@ static inline int acpi_dev_prop_read_si
        return -ENXIO;
    }
    
 +  static inline int acpi_node_prop_read(struct fwnode_handle *fwnode,
 +                                    const char *propname,
 +                                    enum dev_prop_type proptype,
 +                                    void *val, size_t nval)
 +  {
 +      return -ENXIO;
 +  }
 +  
    static inline int acpi_dev_prop_read(struct acpi_device *adev,
                                     const char *propname,
                                     enum dev_prop_type proptype,
        return -ENXIO;
    }
    
 -  static inline struct acpi_device *acpi_get_next_child(struct device *dev,
 -                                                    struct acpi_device *child)
 +  static inline struct fwnode_handle *acpi_get_next_subnode(struct device *dev,
 +                                              struct fwnode_handle *subnode)
    {
        return NULL;
    }
   +
 + +#define ACPI_DECLARE_PROBE_ENTRY(table, name, table_id, subtable, validate, data, fn) \
 + +    static const void * __acpi_table_##name[]                       \
 + +            __attribute__((unused))                                 \
 + +             = { (void *) table_id,                                 \
 + +                 (void *) subtable,                                 \
 + +                 (void *) valid,                                    \
 + +                 (void *) fn,                                       \
 + +                 (void *) data }
 + +
 + +#define acpi_probe_device_table(t)  ({ int __r = 0; __r;})
    #endif
    
    #endif      /*_LINUX_ACPI_H*/