Changeset 753


Ignore:
Timestamp:
Oct 22, 2022, 9:53:37 AM (3 years ago)
Author:
Paul Smedley
Message:

Code cleanups + disable unsupported HDMI code for now

Location:
GPL/branches/uniaud32-exp
Files:
1 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-exp/alsa-kernel/hda/Makefile

    r737 r753  
    1313#
    1414#===================================================================
    15 FILES = hdac_device.obj array.obj hdac_stream.obj hdac_controller.obj hdac_bus.obj hda_bus_type.obj hdac_regmap.obj hdmi_chmap.obj hdac_component.obj
     15FILES = hdac_device.obj array.obj hdac_stream.obj hdac_controller.obj hdac_bus.obj hda_bus_type.obj hdac_regmap.obj hdmi_chmap.obj hdac_component.obj
     16# hdac_i915.obj
    1617
    1718TARGET = hdac
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/config.h

    r750 r753  
    3232#define CONFIG_SND_HDA_CODEC_CONEXANT
    3333#define CONFIG_SND_HDA_CODEC_CMEDIA
    34 #define CONFIG_SND_HDA_CODEC_HDMI
     34/* #define CONFIG_SND_HDA_CODEC_HDMI not yet supported */
    3535#define CONFIG_SND_HDA_CODEC_REALTEK
    3636#define CONFIG_SND_HDA_CODEC_SIGMATEL
     
    4040#define CONFIG_SND_HDA_GENERIC
    4141#define CONFIG_SND_HDA_HWDEP
     42/* #define CONFIG_SND_HDA_I915 not yet supported */
    4243#define CONFIG_SND_HDA_PREALLOC_SIZE  64
    4344#define CONFIG_SND_OSSEMUL
  • GPL/branches/uniaud32-exp/include/linux/device.h

    r738 r753  
    300300                         dr_match_t match, void *match_data);
    301301
     302/* devres group */
     303void * __must_check devres_open_group(struct device *dev, void *id, gfp_t gfp);
     304void devres_close_group(struct device *dev, void *id);
     305void devres_remove_group(struct device *dev, void *id);
     306int devres_release_group(struct device *dev, void *id);
     307
    302308/* debugging and troubleshooting/diagnostic helpers. */
    303309extern const char *dev_driver_string(const struct device *dev);
  • GPL/branches/uniaud32-exp/include/linux/pci.h

    r744 r753  
    792792void pci_release_region(struct pci_dev *, int);
    793793void __iomem * const *pcim_iomap_table(struct pci_dev *pdev);
     794#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
    794795
    795796#endif /* LINUX_PCI_H */
  • GPL/branches/uniaud32-exp/lib32/component.c

    r737 r753  
    185185                struct component *c;
    186186
    187                 dev_dbg(adev->parent, "Looking for component %zu\n", i);
     187                dev_dbg(adev->parent, "Looking for component %lu\n", i);
    188188
    189189                if (match->compare[i].component)
     
    243243        }
    244244
    245 #ifndef TARGET_OS2
    246245        if (!devres_open_group(adev->parent, adev, GFP_KERNEL))
    247246                return -ENOMEM;
    248 #endif
     247
    249248        /* Found all components */
    250249        ret = adev->ops->bind(adev->parent);
    251250        if (ret < 0) {
    252 #ifndef TARGET_OS2
    253251                devres_release_group(adev->parent, NULL);
    254252                if (ret != -EPROBE_DEFER)
    255253                        dev_info(adev->parent, "adev bind failed: %d\n", ret);
    256 #endif
    257254                return ret;
    258255        }
     
    626623         * affecting anything else.
    627624         */
    628 #ifndef TARGET_OS2
     625
    629626        if (!devres_open_group(adev->parent, NULL, GFP_KERNEL))
    630627                return -ENOMEM;
    631 #endif
     628
    632629        /*
    633630         * Also open a group for the device itself: this allows us
  • GPL/branches/uniaud32-exp/lib32/devres.c

    r744 r753  
    221221}
    222222
    223 static int release_nodes(struct device *dev, struct list_head *first,
    224                          struct list_head *end, unsigned long flags)
    225 {
    226 //      LIST_HEAD(todo);
    227         struct list_head todo;
    228 
    229         int cnt;
     223static void release_nodes(struct device *dev, struct list_head *todo)
     224{
    230225        struct devres *dr, *tmp;
    231 
    232         cnt = remove_nodes(dev, first, end, &todo);
    233 
    234         spin_unlock_irqrestore(&dev->devres_lock, flags);
    235226
    236227        /* Release.  Note that both devres and devres_group are
    237228         * handled as devres in the following loop.  This is safe.
    238229         */
    239         list_for_each_entry_safe_reverse(dr, tmp, &todo, node.entry, struct devres) {
     230        list_for_each_entry_safe_reverse(dr, tmp, todo, node.entry, struct devres) {
    240231                devres_log(dev, &dr->node, "REL");
    241232                dr->node.release(dev, dr->data);
    242233                kfree(dr);
    243234        }
    244 
    245         return cnt;
    246235}
    247236
     
    256245{
    257246        unsigned long flags;
     247        struct list_head todo;
     248        int cnt;
    258249
    259250        /* Looks like an uninitialized device structure */
    260251        if (WARN_ON(dev->devres_head.next == NULL))
    261252                return -ENODEV;
     253
     254        /* Nothing to release if list is empty */
     255        if (list_empty(&dev->devres_head))
     256                return 0;
     257
    262258        spin_lock_irqsave(&dev->devres_lock, flags);
    263         return release_nodes(dev, dev->devres_head.next, &dev->devres_head,
    264                              flags);
    265 }
     259        cnt = remove_nodes(dev, dev->devres_head.next, &dev->devres_head, &todo);
     260        spin_unlock_irqrestore(&dev->devres_lock, flags);
     261
     262        release_nodes(dev, &todo);
     263        return cnt;
     264}
     265
     266/**
     267 * devres_open_group - Open a new devres group
     268 * @dev: Device to open devres group for
     269 * @id: Separator ID
     270 * @gfp: Allocation flags
     271 *
     272 * Open a new devres group for @dev with @id.  For @id, using a
     273 * pointer to an object which won't be used for another group is
     274 * recommended.  If @id is NULL, address-wise unique ID is created.
     275 *
     276 * RETURNS:
     277 * ID of the new group, NULL on failure.
     278 */
     279void * devres_open_group(struct device *dev, void *id, gfp_t gfp)
     280{
     281        struct devres_group *grp;
     282        unsigned long flags;
     283
     284        grp = kmalloc(sizeof(*grp), gfp);
     285        if (unlikely(!grp))
     286                return NULL;
     287
     288        grp->node[0].release = &group_open_release;
     289        grp->node[1].release = &group_close_release;
     290        INIT_LIST_HEAD(&grp->node[0].entry);
     291        INIT_LIST_HEAD(&grp->node[1].entry);
     292        set_node_dbginfo(&grp->node[0], "grp<", 0);
     293        set_node_dbginfo(&grp->node[1], "grp>", 0);
     294        grp->id = grp;
     295        if (id)
     296                grp->id = id;
     297
     298        spin_lock_irqsave(&dev->devres_lock, flags);
     299        add_dr(dev, &grp->node[0]);
     300        spin_unlock_irqrestore(&dev->devres_lock, flags);
     301        return grp->id;
     302}
     303EXPORT_SYMBOL_GPL(devres_open_group);
     304
     305/* Find devres group with ID @id.  If @id is NULL, look for the latest. */
     306static struct devres_group * find_group(struct device *dev, void *id)
     307{
     308        struct devres_node *node;
     309
     310        list_for_each_entry_reverse(node, &dev->devres_head, entry, struct devres_node) {
     311                struct devres_group *grp;
     312
     313                if (node->release != &group_open_release)
     314                        continue;
     315
     316                grp = container_of(node, struct devres_group, node[0]);
     317
     318                if (id) {
     319                        if (grp->id == id)
     320                                return grp;
     321                } else if (list_empty(&grp->node[1].entry))
     322                        return grp;
     323        }
     324
     325        return NULL;
     326}
     327
     328/**
     329 * devres_release_group - Release resources in a devres group
     330 * @dev: Device to release group for
     331 * @id: ID of target group, can be NULL
     332 *
     333 * Release all resources in the group identified by @id.  If @id is
     334 * NULL, the latest open group is selected.  The selected group and
     335 * groups properly nested inside the selected group are removed.
     336 *
     337 * RETURNS:
     338 * The number of released non-group resources.
     339 */
     340int devres_release_group(struct device *dev, void *id)
     341{
     342        struct devres_group *grp;
     343        unsigned long flags;
     344        struct list_head todo;
     345        int cnt = 0;
     346
     347        spin_lock_irqsave(&dev->devres_lock, flags);
     348
     349        grp = find_group(dev, id);
     350        if (grp) {
     351                struct list_head *first = &grp->node[0].entry;
     352                struct list_head *end = &dev->devres_head;
     353
     354                if (!list_empty(&grp->node[1].entry))
     355                        end = grp->node[1].entry.next;
     356
     357                cnt = remove_nodes(dev, first, end, &todo);
     358                spin_unlock_irqrestore(&dev->devres_lock, flags);
     359
     360                release_nodes(dev, &todo);
     361        } else {
     362                WARN_ON(1);
     363                spin_unlock_irqrestore(&dev->devres_lock, flags);
     364        }
     365
     366        return cnt;
     367}
     368EXPORT_SYMBOL_GPL(devres_release_group);
    266369
    267370static struct devres *find_dr(struct device *dev, dr_release_t release,
Note: See TracChangeset for help on using the changeset viewer.