• Home
  • Raw
  • Download

Lines Matching refs:sdev

42 	struct scoop_dev *sdev = dev_get_drvdata(dev);  in reset_scoop()  local
44 iowrite16(0x0100, sdev->base + SCOOP_MCR); /* 00 */ in reset_scoop()
45 iowrite16(0x0000, sdev->base + SCOOP_CDR); /* 04 */ in reset_scoop()
46 iowrite16(0x0000, sdev->base + SCOOP_CCR); /* 10 */ in reset_scoop()
47 iowrite16(0x0000, sdev->base + SCOOP_IMR); /* 18 */ in reset_scoop()
48 iowrite16(0x00FF, sdev->base + SCOOP_IRM); /* 14 */ in reset_scoop()
49 iowrite16(0x0000, sdev->base + SCOOP_ISR); /* 1C */ in reset_scoop()
50 iowrite16(0x0000, sdev->base + SCOOP_IRM); in reset_scoop()
53 static void __scoop_gpio_set(struct scoop_dev *sdev, in __scoop_gpio_set() argument
58 gpwr = ioread16(sdev->base + SCOOP_GPWR); in __scoop_gpio_set()
63 iowrite16(gpwr, sdev->base + SCOOP_GPWR); in __scoop_gpio_set()
68 struct scoop_dev *sdev = gpiochip_get_data(chip); in scoop_gpio_set() local
71 spin_lock_irqsave(&sdev->scoop_lock, flags); in scoop_gpio_set()
73 __scoop_gpio_set(sdev, offset, value); in scoop_gpio_set()
75 spin_unlock_irqrestore(&sdev->scoop_lock, flags); in scoop_gpio_set()
80 struct scoop_dev *sdev = gpiochip_get_data(chip); in scoop_gpio_get() local
83 return !!(ioread16(sdev->base + SCOOP_GPRR) & (1 << (offset + 1))); in scoop_gpio_get()
89 struct scoop_dev *sdev = gpiochip_get_data(chip); in scoop_gpio_direction_input() local
93 spin_lock_irqsave(&sdev->scoop_lock, flags); in scoop_gpio_direction_input()
95 gpcr = ioread16(sdev->base + SCOOP_GPCR); in scoop_gpio_direction_input()
97 iowrite16(gpcr, sdev->base + SCOOP_GPCR); in scoop_gpio_direction_input()
99 spin_unlock_irqrestore(&sdev->scoop_lock, flags); in scoop_gpio_direction_input()
107 struct scoop_dev *sdev = gpiochip_get_data(chip); in scoop_gpio_direction_output() local
111 spin_lock_irqsave(&sdev->scoop_lock, flags); in scoop_gpio_direction_output()
113 __scoop_gpio_set(sdev, offset, value); in scoop_gpio_direction_output()
115 gpcr = ioread16(sdev->base + SCOOP_GPCR); in scoop_gpio_direction_output()
117 iowrite16(gpcr, sdev->base + SCOOP_GPCR); in scoop_gpio_direction_output()
119 spin_unlock_irqrestore(&sdev->scoop_lock, flags); in scoop_gpio_direction_output()
126 struct scoop_dev *sdev = dev_get_drvdata(dev); in read_scoop_reg() local
127 return ioread16(sdev->base + reg); in read_scoop_reg()
132 struct scoop_dev *sdev = dev_get_drvdata(dev); in write_scoop_reg() local
133 iowrite16(data, sdev->base + reg); in write_scoop_reg()
141 static void check_scoop_reg(struct scoop_dev *sdev) in check_scoop_reg() argument
145 mcr = ioread16(sdev->base + SCOOP_MCR); in check_scoop_reg()
147 iowrite16(0x0101, sdev->base + SCOOP_MCR); in check_scoop_reg()
152 struct scoop_dev *sdev = platform_get_drvdata(dev); in scoop_suspend() local
154 check_scoop_reg(sdev); in scoop_suspend()
155 sdev->scoop_gpwr = ioread16(sdev->base + SCOOP_GPWR); in scoop_suspend()
156 iowrite16((sdev->scoop_gpwr & ~sdev->suspend_clr) | sdev->suspend_set, sdev->base + SCOOP_GPWR); in scoop_suspend()
163 struct scoop_dev *sdev = platform_get_drvdata(dev); in scoop_resume() local
165 check_scoop_reg(sdev); in scoop_resume()
166 iowrite16(sdev->scoop_gpwr, sdev->base + SCOOP_GPWR); in scoop_resume()
241 struct scoop_dev *sdev = platform_get_drvdata(pdev); in scoop_remove() local
243 if (!sdev) in scoop_remove()
246 if (sdev->gpio.base != -1) in scoop_remove()
247 gpiochip_remove(&sdev->gpio); in scoop_remove()
250 iounmap(sdev->base); in scoop_remove()
251 kfree(sdev); in scoop_remove()