Changeset 718


Ignore:
Timestamp:
Sep 2, 2022, 4:26:36 AM (3 years ago)
Author:
Paul Smedley
Message:

WIP trying to fix non-HDA Hardware

Location:
GPL/branches/uniaud32-next
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-next/include/linux/device.h

    r716 r718  
    9292static inline const char *dev_name(const struct device *dev)
    9393{
     94#if 0
    9495        /* Use the init name until the kobject becomes available */
    9596        if (dev->init_name)
     
    9798
    9899        return kobject_name(&dev->kobj);
     100#else
     101        return "uniaud32";
     102#endif
    99103}
    100104
     
    218222typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
    219223
     224#define NUMA_NO_NODE    (-1)
     225#if 0
    220226extern void *devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp,
    221227                               int nid);
    222 #define NUMA_NO_NODE    (-1)
    223228static inline void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp)
    224229{
    225230        return devres_alloc_node(release, size, gfp, NUMA_NO_NODE);
    226231}
    227 
     232#else
     233void *__devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp,
     234                          int nid, const char *name);
     235#define devres_alloc(release, size, gfp) \
     236        __devres_alloc_node(release, size, gfp, NUMA_NO_NODE, #release)
     237#endif
    228238/**
    229239 * struct class - device classes
     
    290300/* debugging and troubleshooting/diagnostic helpers. */
    291301extern const char *dev_driver_string(const struct device *dev);
    292 #define devm_kzalloc(A, B, C) kzalloc(B, C)
    293 #define devm_kmalloc(A, B, C) kmalloc(B, C)
    294 #define devm_kcalloc(A, B, C, D) kmalloc(B, C)
    295 #define devm_kmalloc_array(A, B, C, D) kmalloc_array(B, C, D)
    296 
     302void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp);
     303
     304static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp)
     305{
     306        return devm_kmalloc(dev, size, gfp | __GFP_ZERO);
     307}
     308
     309static inline void *devm_kmalloc_array(struct device *dev,
     310                                       size_t n, size_t size, gfp_t flags)
     311{
     312//      size_t bytes;
     313
     314//      if (unlikely(check_mul_overflow(n, size, &bytes)))
     315//              return NULL;
     316
     317        return devm_kmalloc(dev, n * size, flags);
     318}
     319static inline void *devm_kcalloc(struct device *dev,
     320                                 size_t n, size_t size, gfp_t flags)
     321{
     322        return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO);
     323}
    297324
    298325/* allows to add/remove a custom action to devres stack */
    299326int devm_add_action(struct device *dev, void (*action)(void *), void *data);
    300327void devm_remove_action(struct device *dev, void (*action)(void *), void *data);
     328
     329static inline int dev_to_node(struct device *dev)
     330{
     331        return NUMA_NO_NODE;
     332}
    301333#endif /* _LINUX_DEVICE_H */
    302334
  • GPL/branches/uniaud32-next/include/linux/interrupt.h

    r710 r718  
    154154
    155155static inline void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id) {}
    156 #define devm_request_irq(A, B, C, D, E, F) request_irq(B, C, D, E, F)
    157156
     157extern int __must_check
     158devm_request_threaded_irq(struct device *dev, unsigned int irq,
     159                          irq_handler_t handler, irq_handler_t thread_fn,
     160                          unsigned long irqflags, const char *devname,
     161                          void *dev_id);
     162
     163static inline int __must_check
     164devm_request_irq(struct device *dev, unsigned int irq, irq_handler_t handler,
     165                 unsigned long irqflags, const char *devname, void *dev_id)
     166{
     167        return devm_request_threaded_irq(dev, irq, handler, NULL, irqflags,
     168                                         devname, dev_id);
     169}
    158170#endif
  • GPL/branches/uniaud32-next/include/linux/io.h

    r710 r718  
    77#include <linux/err.h>
    88
    9 #define devm_ioremap(A, B, C) ioremap(B, C)
    109#endif /* _LINUX_IO_H */
  • GPL/branches/uniaud32-next/include/linux/ioport.h

    r710 r718  
    111111extern int autoirq_report(int waittime);
    112112
    113 #define devm_request_region(A, B, C, D) request_region(B, C, D)
     113extern struct resource * __devm_request_region(struct device *dev,
     114                                struct resource *parent, resource_size_t start,
     115                                resource_size_t n, const char *name);
     116
     117#define devm_request_region(dev,start,n,name) \
     118        __devm_request_region(dev, &ioport_resource, (start), (n), (name))
    114119#endif  /* _LINUX_IOPORT_H */
  • GPL/branches/uniaud32-next/include/linux/types.h

    r655 r718  
    135135        unsigned long name[((bits)+BITS_PER_LONG-1)/BITS_PER_LONG]
    136136
     137typedef u32 phys_addr_t;
     138typedef phys_addr_t resource_size_t;
     139
    137140#endif /* _LINUX_TYPES_H */
  • GPL/branches/uniaud32-next/lib32/devres.c

    r716 r718  
    1313#include <linux/gfp.h>
    1414#include <linux/errno.h>
     15#include <asm/io.h>
    1516
    1617struct devres_node {
    1718        struct list_head                entry;
    1819        dr_release_t                    release;
    19 #ifdef CONFIG_DEBUG_DEVRES
    2020        const char                      *name;
    2121        size_t                          size;
    22 #endif
    2322};
    2423
     
    2625        struct devres_node              node;
    2726        /* -- 3 pointers */
    28         unsigned long long              data[]; /* guarantee ull alignment */
     27        u8              data[]; /* guarantee ull alignment */
    2928};
    3029
     
    3635};
    3736
     37static void set_node_dbginfo(struct devres_node *node, const char *name,
     38                             size_t size)
     39{
     40        node->name = name;
     41        node->size = size;
     42}
     43
    3844#define devres_log(dev, node, op)       do {} while (0)
    3945
     
    8389        BUG_ON(!list_empty(&node->entry));
    8490//#ifndef TARGET_OS2
    85         /* Traps here on OS/2 */
     91        /* Traps here on OS/2 - release builds on non-HDA hardware only */
     92        rprintf(("add_dr"));
    8693        list_add_tail(&node->entry, &dev->devres_head);
     94        rprintf(("add_dr2"));
    8795//#endif
    8896}
     
    99107void devres_add(struct device *dev, void *res)
    100108{
    101         /* Traps here on OS/2 */
    102109        struct devres *dr = container_of(res, struct devres, data);
    103110        unsigned long flags;
     111
    104112        spin_lock_irqsave(&dev->devres_lock, flags);
    105113        add_dr(dev, &dr->node);
     
    108116
    109117/**
    110  * devres_alloc - Allocate device resource data
     118 * __devres_alloc_node - Allocate device resource data
    111119 * @release: Release function devres will be associated with
    112120 * @size: Allocation size
    113121 * @gfp: Allocation flags
    114122 * @nid: NUMA node
     123 * @name: Name of the resource
    115124 *
    116125 * Allocate devres of @size bytes.  The allocated area is zeroed, then
     
    121130 * Pointer to allocated devres on success, NULL on failure.
    122131 */
    123 void * devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid)
     132void *__devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid,
     133                          const char *name)
    124134{
    125135        struct devres *dr;
    126136
    127137        dr = alloc_dr(release, size, gfp | __GFP_ZERO, nid);
     138        if (unlikely(!dr))
     139                return NULL;
     140        set_node_dbginfo(&dr->node, name, size);
    128141        return dr->data;
    129142}
     
    145158}
    146159
     160#if 0 //2022-09-02
    147161static int remove_nodes(struct device *dev,
    148162                        struct list_head *first, struct list_head *end,
     
    257271                             flags);
    258272}
     273#endif
    259274
    260275static struct devres *find_dr(struct device *dev, dr_release_t release,
     
    305320}
    306321
     322/*
     323 * Custom devres actions allow inserting a simple function call
     324 * into the teadown sequence.
     325 */
     326
     327struct action_devres {
     328        void *data;
     329        void (*action)(void *);
     330};
     331
     332static void devm_action_release(struct device *dev, void *res)
     333{
     334        struct action_devres *devres = res;
     335
     336        devres->action(devres->data);
     337}
     338
    307339/**
    308340 * devm_add_action() - add a custom action to list of managed resources
     
    316348int devm_add_action(struct device *dev, void (*action)(void *), void *data)
    317349{
     350        struct action_devres *devres;
     351
     352        devres = devres_alloc(devm_action_release,
     353                              sizeof(struct action_devres), GFP_KERNEL);
     354        if (!devres)
     355                return -ENOMEM;
     356
     357        devres->data = data;
     358        devres->action = action;
     359
     360        devres_add(dev, devres);
     361
    318362        return 0;
    319363}
     
    331375{
    332376}
     377
     378/*
     379 * Managed kmalloc/kfree
     380 */
     381static void devm_kmalloc_release(struct device *dev, void *res)
     382{
     383        /* noop */
     384}
     385
     386static int devm_kmalloc_match(struct device *dev, void *res, void *data)
     387{
     388        return res == data;
     389}
     390
     391/**
     392 * devm_kmalloc - Resource-managed kmalloc
     393 * @dev: Device to allocate memory for
     394 * @size: Allocation size
     395 * @gfp: Allocation gfp flags
     396 *
     397 * Managed kmalloc.  Memory allocated with this function is
     398 * automatically freed on driver detach.  Like all other devres
     399 * resources, guaranteed alignment is unsigned long long.
     400 *
     401 * RETURNS:
     402 * Pointer to allocated memory on success, NULL on failure.
     403 */
     404void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp)
     405{
     406        struct devres *dr;
     407
     408        if (unlikely(!size))
     409                return ZERO_SIZE_PTR;
     410
     411        /* use raw alloc_dr for kmalloc caller tracing */
     412        dr = alloc_dr(devm_kmalloc_release, size, gfp, dev_to_node(dev));
     413        if (unlikely(!dr))
     414                return NULL;
     415
     416        /*
     417         * This is named devm_kzalloc_release for historical reasons
     418         * The initial implementation did not support kmalloc, only kzalloc
     419         */
     420        set_node_dbginfo(&dr->node, "devm_kzalloc_release", size);
     421        devres_add(dev, dr->data);
     422        return dr->data;
     423}
     424EXPORT_SYMBOL_GPL(devm_kmalloc);
     425
     426enum devm_ioremap_type {
     427        DEVM_IOREMAP = 0,
     428        DEVM_IOREMAP_UC,
     429        DEVM_IOREMAP_WC,
     430        DEVM_IOREMAP_NP,
     431};
     432
     433void devm_ioremap_release(struct device *dev, void *res)
     434{
     435        iounmap(*(void __iomem **)res);
     436}
     437
     438static int devm_ioremap_match(struct device *dev, void *res, void *match_data)
     439{
     440        return *(void **)res == match_data;
     441}
     442
     443static void *__devm_ioremap(struct device *dev, resource_size_t offset,
     444                                    resource_size_t size,
     445                                    enum devm_ioremap_type type)
     446{
     447        void __iomem **ptr, *addr = NULL;
     448
     449        ptr = devres_alloc(devm_ioremap_release, sizeof(*ptr), GFP_KERNEL);
     450        if (!ptr)
     451                return NULL;
     452
     453        switch (type) {
     454        case DEVM_IOREMAP:
     455                addr = ioremap(offset, size);
     456                break;
     457#if 0
     458        case DEVM_IOREMAP_UC:
     459                addr = ioremap_uc(offset, size);
     460                break;
     461        case DEVM_IOREMAP_WC:
     462                addr = ioremap_wc(offset, size);
     463                break;
     464        case DEVM_IOREMAP_NP:
     465                addr = ioremap_np(offset, size);
     466                break;
     467#endif
     468        }
     469
     470        if (addr) {
     471                *ptr = addr;
     472                devres_add(dev, ptr);
     473        } else
     474                devres_free(ptr);
     475
     476        return addr;
     477}
     478
     479/**
     480 * devm_ioremap - Managed ioremap()
     481 * @dev: Generic device to remap IO address for
     482 * @offset: Resource address to map
     483 * @size: Size of map
     484 *
     485 * Managed ioremap().  Map is automatically unmapped on driver detach.
     486 */
     487void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
     488                           resource_size_t size)
     489{
     490        return __devm_ioremap(dev, offset, size, DEVM_IOREMAP);
     491}
     492EXPORT_SYMBOL(devm_ioremap);
  • GPL/branches/uniaud32-next/lib32/driver.c

    r716 r718  
    613613                else if (drv->remove)
    614614                        drv->remove(dev);
    615                 devres_release_all(dev);
     615//              devres_release_all(dev);
    616616                dev->driver = NULL;
    617617                klist_remove(&dev->p->knode_driver);
  • GPL/branches/uniaud32-next/lib32/drivers_base.c

    r625 r718  
    173173         */
    174174        drv = dev->driver;
     175#if 0
    175176        return drv ? drv->name :
    176177                        (dev->bus ? dev->bus->name :
    177178                        (dev->class ? dev->class->name : ""));
     179#else
     180        return "uniaud32";
     181#endif
    178182}
  • GPL/branches/uniaud32-next/lib32/irq.c

    r604 r718  
    249249//******************************************************************************
    250250
     251/*
     252 * Device resource management aware IRQ request/free implementation.
     253 */
     254struct irq_devres {
     255        unsigned int irq;
     256        void *dev_id;
     257};
     258
     259static void devm_irq_release(struct device *dev, void *res)
     260{
     261        struct irq_devres *this = res;
     262
     263        free_irq(this->irq, this->dev_id);
     264}
     265
     266/**
     267 *      devm_request_threaded_irq - allocate an interrupt line for a managed device
     268 *      @dev: device to request interrupt for
     269 *      @irq: Interrupt line to allocate
     270 *      @handler: Function to be called when the IRQ occurs
     271 *      @thread_fn: function to be called in a threaded interrupt context. NULL
     272 *                  for devices which handle everything in @handler
     273 *      @irqflags: Interrupt type flags
     274 *      @devname: An ascii name for the claiming device, dev_name(dev) if NULL
     275 *      @dev_id: A cookie passed back to the handler function
     276 *
     277 *      Except for the extra @dev argument, this function takes the
     278 *      same arguments and performs the same function as
     279 *      request_threaded_irq().  IRQs requested with this function will be
     280 *      automatically freed on driver detach.
     281 *
     282 *      If an IRQ allocated with this function needs to be freed
     283 *      separately, devm_free_irq() must be used.
     284 */
     285int devm_request_threaded_irq(struct device *dev, unsigned int irq,
     286                              irq_handler_t handler, irq_handler_t thread_fn,
     287                              unsigned long irqflags, const char *devname,
     288                              void *dev_id)
     289{
     290        struct irq_devres *dr;
     291        int rc;
     292
     293        dr = devres_alloc(devm_irq_release, sizeof(struct irq_devres),
     294                          GFP_KERNEL);
     295        if (!dr)
     296                return -ENOMEM;
     297
     298        if (!devname)
     299                devname = dev_name(dev);
     300
     301        rc = request_irq(irq, handler, irqflags, devname,
     302                                  dev_id);
     303        if (rc) {
     304                devres_free(dr);
     305                return rc;
     306        }
     307
     308        dr->irq = irq;
     309        dr->dev_id = dev_id;
     310        devres_add(dev, dr);
     311
     312        return 0;
     313}
  • GPL/branches/uniaud32-next/lib32/pci.c

    r713 r718  
    11801180}
    11811181
     1182struct region_devres {
     1183        struct resource *parent;
     1184        resource_size_t start;
     1185        resource_size_t n;
     1186};
     1187
     1188static void devm_region_release(struct device *dev, void *res)
     1189{
     1190        struct region_devres *this = res;
     1191
     1192        __release_region(this->parent, this->start, this->n);
     1193}
     1194
     1195struct resource *
     1196__devm_request_region(struct device *dev, struct resource *parent,
     1197                      resource_size_t start, resource_size_t n, const char *name)
     1198{
     1199        struct region_devres *dr = NULL;
     1200        struct resource *res;
     1201
     1202        dr = devres_alloc(devm_region_release, sizeof(struct region_devres),
     1203                          GFP_KERNEL);
     1204        if (!dr)
     1205                return NULL;
     1206
     1207        dr->parent = parent;
     1208        dr->start = start;
     1209        dr->n = n;
     1210
     1211        res = __request_region(parent, start, n, name);
     1212        if (res)
     1213                devres_add(dev, dr);
     1214        else
     1215                devres_free(dr);
     1216
     1217        return res;
     1218}
     1219EXPORT_SYMBOL(__devm_request_region);
  • GPL/branches/uniaud32-next/lib32/regcache.c

    r652 r718  
    2222#include "internal.h"
    2323
    24 static const struct regcache_ops *cache_types[] = {
     24/*static*/ const struct regcache_ops *cache_types[] = {
    2525        &regcache_rbtree_ops,
    2626#if IS_ENABLED(CONFIG_REGCACHE_COMPRESSED)
     
    3030};
    3131
    32 static int regcache_hw_init(struct regmap *map)
     32/*static*/ int regcache_hw_init(struct regmap *map)
    3333{
    3434        int i, j;
     
    283283}
    284284
    285 static bool regcache_reg_needs_sync(struct regmap *map, unsigned int reg,
     285/*static*/ bool regcache_reg_needs_sync(struct regmap *map, unsigned int reg,
    286286                                    unsigned int val)
    287287{
     
    299299}
    300300
    301 static int regcache_default_sync(struct regmap *map, unsigned int min,
     301/*static*/ int regcache_default_sync(struct regmap *map, unsigned int min,
    302302                                 unsigned int max)
    303303{
     
    649649}
    650650
    651 static int regcache_default_cmp(const void *a, const void *b)
     651/*static*/ int regcache_default_cmp(const void *a, const void *b)
    652652{
    653653        const struct reg_default *_a = a;
     
    674674}
    675675
    676 static bool regcache_reg_present(unsigned long *cache_present, unsigned int idx)
     676/*static*/ bool regcache_reg_present(unsigned long *cache_present, unsigned int idx)
    677677{
    678678        if (!cache_present)
     
    682682}
    683683
    684 static int regcache_sync_block_single(struct regmap *map, void *block,
     684/*static*/ int regcache_sync_block_single(struct regmap *map, void *block,
    685685                                      unsigned long *cache_present,
    686686                                      unsigned int block_base,
     
    718718}
    719719
    720 static int regcache_sync_block_raw_flush(struct regmap *map, const void **data,
     720/*static*/ int regcache_sync_block_raw_flush(struct regmap *map, const void **data,
    721721                                         unsigned int base, unsigned int cur)
    722722{
     
    746746}
    747747
    748 static int regcache_sync_block_raw(struct regmap *map, void *block,
     748/*static*/ int regcache_sync_block_raw(struct regmap *map, void *block,
    749749                            unsigned long *cache_present,
    750750                            unsigned int block_base, unsigned int start,
  • GPL/branches/uniaud32-next/lib32/regmap.c

    r654 r718  
    4545
    4646#ifdef LOG_DEVICE
    47 static inline bool regmap_should_log(struct regmap *map)
     47/*static*/ inline bool regmap_should_log(struct regmap *map)
    4848{
    4949        return (map->dev && strcmp(dev_name(map->dev), LOG_DEVICE) == 0);
    5050}
    5151#else
    52 static inline bool regmap_should_log(struct regmap *map) { return false; }
    53 #endif
    54 
    55 
    56 static int _regmap_update_bits(struct regmap *map, unsigned int reg,
     52/*static*/ inline bool regmap_should_log(struct regmap *map) { return false; }
     53#endif
     54
     55
     56/*static*/ int _regmap_update_bits(struct regmap *map, unsigned int reg,
    5757                               unsigned int mask, unsigned int val,
    5858                               bool *change, bool force_write);
    5959
    60 static int _regmap_bus_reg_read(void *context, unsigned int reg,
     60/*static*/ int _regmap_bus_reg_read(void *context, unsigned int reg,
    6161                                unsigned int *val);
    62 static int _regmap_bus_read(void *context, unsigned int reg,
     62/*static*/ int _regmap_bus_read(void *context, unsigned int reg,
    6363                            unsigned int *val);
    64 static int _regmap_bus_formatted_write(void *context, unsigned int reg,
     64/*static*/ int _regmap_bus_formatted_write(void *context, unsigned int reg,
    6565                                       unsigned int val);
    66 static int _regmap_bus_reg_write(void *context, unsigned int reg,
     66/*static*/ int _regmap_bus_reg_write(void *context, unsigned int reg,
    6767                                 unsigned int val);
    68 static int _regmap_bus_raw_write(void *context, unsigned int reg,
     68/*static*/ int _regmap_bus_raw_write(void *context, unsigned int reg,
    6969                                 unsigned int val);
    7070
     
    209209}
    210210
    211 static bool regmap_volatile_range(struct regmap *map, unsigned int reg,
     211/*static*/ bool regmap_volatile_range(struct regmap *map, unsigned int reg,
    212212        size_t num)
    213213{
     
    221221}
    222222
    223 static void regmap_format_12_20_write(struct regmap *map,
     223/*static*/ void regmap_format_12_20_write(struct regmap *map,
    224224                                     unsigned int reg, unsigned int val)
    225225{
     
    233233
    234234
    235 static void regmap_format_2_6_write(struct regmap *map,
     235/*static*/ void regmap_format_2_6_write(struct regmap *map,
    236236                                     unsigned int reg, unsigned int val)
    237237{
     
    241241}
    242242
    243 static void regmap_format_4_12_write(struct regmap *map,
     243/*static*/ void regmap_format_4_12_write(struct regmap *map,
    244244                                     unsigned int reg, unsigned int val)
    245245{
     
    248248}
    249249
    250 static void regmap_format_7_9_write(struct regmap *map,
     250/*static*/ void regmap_format_7_9_write(struct regmap *map,
    251251                                    unsigned int reg, unsigned int val)
    252252{
     
    255255}
    256256
    257 static void regmap_format_10_14_write(struct regmap *map,
     257/*static*/ void regmap_format_10_14_write(struct regmap *map,
    258258                                    unsigned int reg, unsigned int val)
    259259{
     
    265265}
    266266
    267 static void regmap_format_8(void *buf, unsigned int val, unsigned int shift)
     267/*static*/ void regmap_format_8(void *buf, unsigned int val, unsigned int shift)
    268268{
    269269        u8 *b = buf;
     
    272272}
    273273
    274 static void regmap_format_16_be(void *buf, unsigned int val, unsigned int shift)
     274/*static*/ void regmap_format_16_be(void *buf, unsigned int val, unsigned int shift)
    275275{
    276276        put_unaligned_be16(val << shift, buf);
    277277}
    278278
    279 static void regmap_format_16_le(void *buf, unsigned int val, unsigned int shift)
     279/*static*/ void regmap_format_16_le(void *buf, unsigned int val, unsigned int shift)
    280280{
    281281        put_unaligned_le16(val << shift, buf);
    282282}
    283283
    284 static void regmap_format_16_native(void *buf, unsigned int val,
     284/*static*/ void regmap_format_16_native(void *buf, unsigned int val,
    285285                                    unsigned int shift)
    286286{
     
    290290}
    291291
    292 static void regmap_format_24(void *buf, unsigned int val, unsigned int shift)
     292/*static*/ void regmap_format_24(void *buf, unsigned int val, unsigned int shift)
    293293{
    294294        u8 *b = buf;
     
    301301}
    302302
    303 static void regmap_format_32_be(void *buf, unsigned int val, unsigned int shift)
     303/*static*/ void regmap_format_32_be(void *buf, unsigned int val, unsigned int shift)
    304304{
    305305        put_unaligned_be32(val << shift, buf);
    306306}
    307307
    308 static void regmap_format_32_le(void *buf, unsigned int val, unsigned int shift)
     308/*static*/ void regmap_format_32_le(void *buf, unsigned int val, unsigned int shift)
    309309{
    310310        put_unaligned_le32(val << shift, buf);
    311311}
    312312
    313 static void regmap_format_32_native(void *buf, unsigned int val,
     313/*static*/ void regmap_format_32_native(void *buf, unsigned int val,
    314314                                    unsigned int shift)
    315315{
     
    320320
    321321#ifdef CONFIG_64BIT
    322 static void regmap_format_64_be(void *buf, unsigned int val, unsigned int shift)
     322/*static*/ void regmap_format_64_be(void *buf, unsigned int val, unsigned int shift)
    323323{
    324324        put_unaligned_be64((u64) val << shift, buf);
    325325}
    326326
    327 static void regmap_format_64_le(void *buf, unsigned int val, unsigned int shift)
     327/*static*/ void regmap_format_64_le(void *buf, unsigned int val, unsigned int shift)
    328328{
    329329        put_unaligned_le64((u64) val << shift, buf);
    330330}
    331331
    332 static void regmap_format_64_native(void *buf, unsigned int val,
     332/*static*/ void regmap_format_64_native(void *buf, unsigned int val,
    333333                                    unsigned int shift)
    334334{
     
    339339#endif
    340340
    341 static void regmap_parse_inplace_noop(void *buf)
    342 {
    343 }
    344 
    345 static unsigned int regmap_parse_8(const void *buf)
     341/*static*/ void regmap_parse_inplace_noop(void *buf)
     342{
     343}
     344
     345/*static*/ unsigned int regmap_parse_8(const void *buf)
    346346{
    347347        const u8 *b = buf;
     
    350350}
    351351
    352 static unsigned int regmap_parse_16_be(const void *buf)
     352/*static*/ unsigned int regmap_parse_16_be(const void *buf)
    353353{
    354354        return get_unaligned_be16(buf);
    355355}
    356356
    357 static unsigned int regmap_parse_16_le(const void *buf)
     357/*static*/ unsigned int regmap_parse_16_le(const void *buf)
    358358{
    359359        return get_unaligned_le16(buf);
    360360}
    361361
    362 static void regmap_parse_16_be_inplace(void *buf)
     362/*static*/ void regmap_parse_16_be_inplace(void *buf)
    363363{
    364364        u16 v = get_unaligned_be16(buf);
     
    367367}
    368368
    369 static void regmap_parse_16_le_inplace(void *buf)
     369/*static*/ void regmap_parse_16_le_inplace(void *buf)
    370370{
    371371        u16 v = get_unaligned_le16(buf);
     
    374374}
    375375
    376 static unsigned int regmap_parse_16_native(const void *buf)
     376/*static*/ unsigned int regmap_parse_16_native(const void *buf)
    377377{
    378378        u16 v;
     
    382382}
    383383
    384 static unsigned int regmap_parse_24(const void *buf)
     384/*static*/ unsigned int regmap_parse_24(const void *buf)
    385385{
    386386        const u8 *b = buf;
     
    392392}
    393393
    394 static unsigned int regmap_parse_32_be(const void *buf)
     394/*static*/ unsigned int regmap_parse_32_be(const void *buf)
    395395{
    396396        return get_unaligned_be32(buf);
    397397}
    398398
    399 static unsigned int regmap_parse_32_le(const void *buf)
     399/*static*/ unsigned int regmap_parse_32_le(const void *buf)
    400400{
    401401        return get_unaligned_le32(buf);
    402402}
    403403
    404 static void regmap_parse_32_be_inplace(void *buf)
     404/*static*/ void regmap_parse_32_be_inplace(void *buf)
    405405{
    406406        u32 v = get_unaligned_be32(buf);
     
    409409}
    410410
    411 static void regmap_parse_32_le_inplace(void *buf)
     411/*static*/ void regmap_parse_32_le_inplace(void *buf)
    412412{
    413413        u32 v = get_unaligned_le32(buf);
     
    416416}
    417417
    418 static unsigned int regmap_parse_32_native(const void *buf)
     418/*static*/ unsigned int regmap_parse_32_native(const void *buf)
    419419{
    420420        u32 v;
     
    425425
    426426#ifdef CONFIG_64BIT
    427 static unsigned int regmap_parse_64_be(const void *buf)
     427/*static*/ unsigned int regmap_parse_64_be(const void *buf)
    428428{
    429429        return get_unaligned_be64(buf);
    430430}
    431431
    432 static unsigned int regmap_parse_64_le(const void *buf)
     432/*static*/ unsigned int regmap_parse_64_le(const void *buf)
    433433{
    434434        return get_unaligned_le64(buf);
    435435}
    436436
    437 static void regmap_parse_64_be_inplace(void *buf)
     437/*static*/ void regmap_parse_64_be_inplace(void *buf)
    438438{
    439439        u64 v =  get_unaligned_be64(buf);
     
    442442}
    443443
    444 static void regmap_parse_64_le_inplace(void *buf)
     444/*static*/ void regmap_parse_64_le_inplace(void *buf)
    445445{
    446446        u64 v = get_unaligned_le64(buf);
     
    449449}
    450450
    451 static unsigned int regmap_parse_64_native(const void *buf)
     451/*static*/ unsigned int regmap_parse_64_native(const void *buf)
    452452{
    453453        u64 v;
     
    458458#endif
    459459
    460 static void regmap_lock_hwlock(void *__map)
     460/*static*/ void regmap_lock_hwlock(void *__map)
    461461{
    462462#ifndef TARGET_OS2
     
    467467}
    468468
    469 static void regmap_lock_hwlock_irq(void *__map)
     469/*static*/ void regmap_lock_hwlock_irq(void *__map)
    470470{
    471471#ifndef TARGET_OS2
     
    476476}
    477477
    478 static void regmap_lock_hwlock_irqsave(void *__map)
     478/*static*/ void regmap_lock_hwlock_irqsave(void *__map)
    479479{
    480480#ifndef TARGET_OS2
     
    486486}
    487487
    488 static void regmap_unlock_hwlock(void *__map)
     488/*static*/ void regmap_unlock_hwlock(void *__map)
    489489{
    490490#ifndef TARGET_OS2
     
    495495}
    496496
    497 static void regmap_unlock_hwlock_irq(void *__map)
     497/*static*/ void regmap_unlock_hwlock_irq(void *__map)
    498498{
    499499#ifndef TARGET_OS2
     
    504504}
    505505
    506 static void regmap_unlock_hwlock_irqrestore(void *__map)
     506/*static*/ void regmap_unlock_hwlock_irqrestore(void *__map)
    507507{
    508508#ifndef TARGET_OS2
     
    513513}
    514514
    515 static void regmap_lock_unlock_none(void *__map)
    516 {
    517 
    518 }
    519 
    520 static void regmap_lock_mutex(void *__map)
     515/*static*/ void regmap_lock_unlock_none(void *__map)
     516{
     517
     518}
     519
     520/*static*/ void regmap_lock_mutex(void *__map)
    521521{
    522522        struct regmap *map = __map;
     
    524524}
    525525
    526 static void regmap_unlock_mutex(void *__map)
     526/*static*/ void regmap_unlock_mutex(void *__map)
    527527{
    528528        struct regmap *map = __map;
     
    530530}
    531531
    532 static void regmap_lock_spinlock(void *__map)
     532/*static*/ void regmap_lock_spinlock(void *__map)
    533533__acquires(&map->spinlock)
    534534{
     
    540540}
    541541
    542 static void regmap_unlock_spinlock(void *__map)
     542/*static*/ void regmap_unlock_spinlock(void *__map)
    543543__releases(&map->spinlock)
    544544{
     
    547547}
    548548
    549 static void dev_get_regmap_release(struct device *dev, void *res)
     549/*static*/ void dev_get_regmap_release(struct device *dev, void *res)
    550550{
    551551        /*
     
    556556}
    557557
    558 static bool _regmap_range_add(struct regmap *map,
     558/*static*/ bool _regmap_range_add(struct regmap *map,
    559559                              struct regmap_range_node *data)
    560560{
     
    581581}
    582582
    583 static struct regmap_range_node *_regmap_range_lookup(struct regmap *map,
     583/*static*/ struct regmap_range_node *_regmap_range_lookup(struct regmap *map,
    584584                                                      unsigned int reg)
    585585{
     
    601601}
    602602
    603 static void regmap_range_exit(struct regmap *map)
     603/*static*/ void regmap_range_exit(struct regmap *map)
    604604{
    605605        struct rb_node *next;
     
    617617}
    618618
    619 static int regmap_set_name(struct regmap *map, const struct regmap_config *config)
     619/*static*/ int regmap_set_name(struct regmap *map, const struct regmap_config *config)
    620620{
    621621        if (config->name) {
     
    652652                return ret;
    653653
     654        regmap_debugfs_exit(map);
    654655        regmap_debugfs_init(map);
    655656
     
    667668EXPORT_SYMBOL_GPL(regmap_attach_dev);
    668669
    669 static enum regmap_endian regmap_get_reg_endian(const struct regmap_bus *bus,
     670/*static*/ enum regmap_endian regmap_get_reg_endian(const struct regmap_bus *bus,
    670671                                        const struct regmap_config *config)
    671672{
     
    12511252
    12521253#ifndef TARGET_OS2
    1253 static void devm_regmap_release(struct device *dev, void *res)
     1254/*static*/ void devm_regmap_release(struct device *dev, void *res)
    12541255{
    12551256        regmap_exit(*(struct regmap **)res);
     
    12831284#endif
    12841285
    1285 static void regmap_field_init(struct regmap_field *rm_field,
     1286/*static*/ void regmap_field_init(struct regmap_field *rm_field,
    12861287        struct regmap *regmap, struct reg_field reg_field)
    12871288{
     
    15611562EXPORT_SYMBOL_GPL(regmap_exit);
    15621563
    1563 static int dev_get_regmap_match(struct device *dev, void *res, void *data)
     1564/*static*/ int dev_get_regmap_match(struct device *dev, void *res, void *data)
    15641565{
    15651566        struct regmap **r = res;
     
    16121613EXPORT_SYMBOL_GPL(regmap_get_device);
    16131614
    1614 static int _regmap_select_page(struct regmap *map, unsigned int *reg,
     1615/*static*/ int _regmap_select_page(struct regmap *map, unsigned int *reg,
    16151616                               struct regmap_range_node *range,
    16161617                               unsigned int val_num)
     
    16601661}
    16611662
    1662 static void regmap_set_work_buf_flag_mask(struct regmap *map, int max_bytes,
     1663/*static*/ void regmap_set_work_buf_flag_mask(struct regmap *map, int max_bytes,
    16631664                                          unsigned long mask)
    16641665{
     
    16751676}
    16761677
    1677 static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
     1678/*static*/ int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
    16781679                                  const void *val, size_t val_len, bool noinc)
    16791680{
     
    19021903EXPORT_SYMBOL_GPL(regmap_get_raw_write_max);
    19031904
    1904 static int _regmap_bus_formatted_write(void *context, unsigned int reg,
     1905/*static*/ int _regmap_bus_formatted_write(void *context, unsigned int reg,
    19051906                                       unsigned int val)
    19061907{
     
    19261927}
    19271928
    1928 static int _regmap_bus_reg_write(void *context, unsigned int reg,
     1929/*static*/ int _regmap_bus_reg_write(void *context, unsigned int reg,
    19291930                                 unsigned int val)
    19301931{
     
    19341935}
    19351936
    1936 static int _regmap_bus_raw_write(void *context, unsigned int reg,
     1937/*static*/ int _regmap_bus_raw_write(void *context, unsigned int reg,
    19371938                                 unsigned int val)
    19381939{
     
    19511952}
    19521953
    1953 static inline void *_regmap_map_get_context(struct regmap *map)
     1954/*static*/ inline void *_regmap_map_get_context(struct regmap *map)
    19541955{
    19551956        return (map->bus) ? map : map->bus_context;
     
    23252326 * relative. The page register has been written if that was necessary.
    23262327 */
    2327 static int _regmap_raw_multi_reg_write(struct regmap *map,
     2328/*static*/ int _regmap_raw_multi_reg_write(struct regmap *map,
    23282329                                       const struct reg_sequence *regs,
    23292330                                       size_t num_regs)
     
    23742375}
    23752376
    2376 static unsigned int _regmap_register_page(struct regmap *map,
     2377/*static*/ unsigned int _regmap_register_page(struct regmap *map,
    23772378                                          unsigned int reg,
    23782379                                          struct regmap_range_node *range)
     
    23832384}
    23842385
    2385 static int _regmap_range_multi_paged_reg_write(struct regmap *map,
     2386/*static*/ int _regmap_range_multi_paged_reg_write(struct regmap *map,
    23862387                                               struct reg_sequence *regs,
    23872388                                               size_t num_regs)
     
    24662467}
    24672468
    2468 static int _regmap_multi_reg_write(struct regmap *map,
     2469/*static*/ int _regmap_multi_reg_write(struct regmap *map,
    24692470                                   const struct reg_sequence *regs,
    24702471                                   size_t num_regs)
     
    26672668EXPORT_SYMBOL_GPL(regmap_raw_write_async);
    26682669
    2669 static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
     2670/*static*/ int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
    26702671                            unsigned int val_len, bool noinc)
    26712672{
     
    26972698}
    26982699
    2699 static int _regmap_bus_reg_read(void *context, unsigned int reg,
     2700/*static*/ int _regmap_bus_reg_read(void *context, unsigned int reg,
    27002701                                unsigned int *val)
    27012702{
     
    27052706}
    27062707
    2707 static int _regmap_bus_read(void *context, unsigned int reg,
     2708/*static*/ int _regmap_bus_read(void *context, unsigned int reg,
    27082709                            unsigned int *val)
    27092710{
     
    27232724}
    27242725
    2725 static int _regmap_read(struct regmap *map, unsigned int reg,
     2726/*static*/ int _regmap_read(struct regmap *map, unsigned int reg,
    27262727                        unsigned int *val)
    27272728{
     
    30643065EXPORT_SYMBOL_GPL(regmap_bulk_read);
    30653066
    3066 static int _regmap_update_bits(struct regmap *map, unsigned int reg,
     3067/*static*/ int _regmap_update_bits(struct regmap *map, unsigned int reg,
    30673068                               unsigned int mask, unsigned int val,
    30683069                               bool *change, bool force_write)
     
    31813182
    31823183#ifndef TARGET_OS2
    3183 static int regmap_async_is_done(struct regmap *map)
     3184/*static*/ int regmap_async_is_done(struct regmap *map)
    31843185{
    31853186        unsigned long flags;
     
    33453346EXPORT_SYMBOL_GPL(regmap_parse_val);
    33463347
    3347 static int __init regmap_initcall(void)
     3348/*static*/ int __init regmap_initcall(void)
    33483349{
    33493350        regmap_debugfs_initcall();
Note: See TracChangeset for help on using the changeset viewer.