Lines Matching refs:dev
55 static int b53_srab_request_grant(struct b53_device *dev)
57 u8 __iomem *regs = dev->priv;
77 static void b53_srab_release_grant(struct b53_device *dev)
79 u8 __iomem *regs = dev->priv;
87 static int b53_srab_op(struct b53_device *dev, u8 page, u8 reg, u32 op)
91 u8 __iomem *regs = dev->priv;
114 static int b53_srab_read8(struct b53_device *dev, u8 page, u8 reg, u8 *val)
116 u8 __iomem *regs = dev->priv;
119 ret = b53_srab_request_grant(dev);
123 ret = b53_srab_op(dev, page, reg, 0);
130 b53_srab_release_grant(dev);
135 static int b53_srab_read16(struct b53_device *dev, u8 page, u8 reg, u16 *val)
137 u8 __iomem *regs = dev->priv;
140 ret = b53_srab_request_grant(dev);
144 ret = b53_srab_op(dev, page, reg, 0);
151 b53_srab_release_grant(dev);
156 static int b53_srab_read32(struct b53_device *dev, u8 page, u8 reg, u32 *val)
158 u8 __iomem *regs = dev->priv;
161 ret = b53_srab_request_grant(dev);
165 ret = b53_srab_op(dev, page, reg, 0);
172 b53_srab_release_grant(dev);
177 static int b53_srab_read48(struct b53_device *dev, u8 page, u8 reg, u64 *val)
179 u8 __iomem *regs = dev->priv;
182 ret = b53_srab_request_grant(dev);
186 ret = b53_srab_op(dev, page, reg, 0);
194 b53_srab_release_grant(dev);
199 static int b53_srab_read64(struct b53_device *dev, u8 page, u8 reg, u64 *val)
201 u8 __iomem *regs = dev->priv;
204 ret = b53_srab_request_grant(dev);
208 ret = b53_srab_op(dev, page, reg, 0);
216 b53_srab_release_grant(dev);
221 static int b53_srab_write8(struct b53_device *dev, u8 page, u8 reg, u8 value)
223 u8 __iomem *regs = dev->priv;
226 ret = b53_srab_request_grant(dev);
232 ret = b53_srab_op(dev, page, reg, B53_SRAB_CMDSTAT_WRITE);
235 b53_srab_release_grant(dev);
240 static int b53_srab_write16(struct b53_device *dev, u8 page, u8 reg,
243 u8 __iomem *regs = dev->priv;
246 ret = b53_srab_request_grant(dev);
252 ret = b53_srab_op(dev, page, reg, B53_SRAB_CMDSTAT_WRITE);
255 b53_srab_release_grant(dev);
260 static int b53_srab_write32(struct b53_device *dev, u8 page, u8 reg,
263 u8 __iomem *regs = dev->priv;
266 ret = b53_srab_request_grant(dev);
272 ret = b53_srab_op(dev, page, reg, B53_SRAB_CMDSTAT_WRITE);
275 b53_srab_release_grant(dev);
281 static int b53_srab_write48(struct b53_device *dev, u8 page, u8 reg,
284 u8 __iomem *regs = dev->priv;
287 ret = b53_srab_request_grant(dev);
294 ret = b53_srab_op(dev, page, reg, B53_SRAB_CMDSTAT_WRITE);
297 b53_srab_release_grant(dev);
303 static int b53_srab_write64(struct b53_device *dev, u8 page, u8 reg,
306 u8 __iomem *regs = dev->priv;
309 ret = b53_srab_request_grant(dev);
316 ret = b53_srab_op(dev, page, reg, B53_SRAB_CMDSTAT_WRITE);
319 b53_srab_release_grant(dev);
339 struct b53_platform_data *pdata = pdev->dev.platform_data;
340 struct b53_device *dev;
345 dev = b53_switch_alloc(&pdev->dev, &b53_srab_ops, pdata->regs);
346 if (!dev)
350 dev->pdata = pdata;
352 platform_set_drvdata(pdev, dev);
354 return b53_switch_register(dev);
359 struct b53_device *dev = platform_get_drvdata(pdev);
361 if (dev)
362 b53_switch_remove(dev);