~ubuntu-branches/debian/experimental/linux-tools/experimental

« back to all changes in this revision

Viewing changes to arch/powerpc/include/asm/scom.h

  • Committer: Package Import Robot
  • Author(s): Ben Hutchings
  • Date: 2014-02-02 16:57:49 UTC
  • mfrom: (1.1.10) (0.1.21 sid)
  • Revision ID: package-import@ubuntu.com-20140202165749-tw94o9t1t0a8txk6
Tags: 3.13-1~exp2
Merge changes from sid up to 3.12.6-3

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
        scom_map_t (*map)(struct device_node *ctrl_dev, u64 reg, u64 count);
55
55
        void (*unmap)(scom_map_t map);
56
56
 
57
 
        u64 (*read)(scom_map_t map, u32 reg);
58
 
        void (*write)(scom_map_t map, u32 reg, u64 value);
 
57
        int (*read)(scom_map_t map, u64 reg, u64 *value);
 
58
        int (*write)(scom_map_t map, u64 reg, u64 value);
59
59
};
60
60
 
61
61
extern const struct scom_controller *scom_controller;
133
133
 * scom_read - Read a SCOM register
134
134
 * @map: Result of scom_map
135
135
 * @reg: Register index within that map
 
136
 * @value: Updated with the value read
 
137
 *
 
138
 * Returns 0 (success) or a negative error code
136
139
 */
137
 
static inline u64 scom_read(scom_map_t map, u32 reg)
 
140
static inline int scom_read(scom_map_t map, u64 reg, u64 *value)
138
141
{
139
 
        return scom_controller->read(map, reg);
 
142
        int rc;
 
143
 
 
144
        rc = scom_controller->read(map, reg, value);
 
145
        if (rc)
 
146
                *value = 0xfffffffffffffffful;
 
147
        return rc;
140
148
}
141
149
 
142
150
/**
144
152
 * @map: Result of scom_map
145
153
 * @reg: Register index within that map
146
154
 * @value: Value to write
 
155
 *
 
156
 * Returns 0 (success) or a negative error code
147
157
 */
148
 
static inline void scom_write(scom_map_t map, u32 reg, u64 value)
 
158
static inline int scom_write(scom_map_t map, u64 reg, u64 value)
149
159
{
150
 
        scom_controller->write(map, reg, value);
 
160
        return scom_controller->write(map, reg, value);
151
161
}
152
162
 
 
163
 
153
164
#endif /* CONFIG_PPC_SCOM */
154
165
#endif /* __ASSEMBLY__ */
155
166
#endif /* __KERNEL__ */