Lines Matching refs:bus
88 static u32 get_reserved(struct intel_gmbus *bus)
90 struct drm_i915_private *dev_priv = bus->dev_priv;
96 reserved = I915_READ_NOTRACE(bus->gpio_reg) &
105 struct intel_gmbus *bus = data;
106 struct drm_i915_private *dev_priv = bus->dev_priv;
107 return (I915_READ_NOTRACE(bus->gpio_reg) & GPIO_CLOCK_VAL_IN) != 0;
112 struct intel_gmbus *bus = data;
113 struct drm_i915_private *dev_priv = bus->dev_priv;
114 return (I915_READ_NOTRACE(bus->gpio_reg) & GPIO_DATA_VAL_IN) != 0;
119 struct intel_gmbus *bus = data;
120 struct drm_i915_private *dev_priv = bus->dev_priv;
121 u32 reserved = get_reserved(bus);
122 I915_WRITE_NOTRACE(bus->gpio_reg, reserved | GPIO_CLOCK_DIR_MASK);
123 I915_WRITE_NOTRACE(bus->gpio_reg, reserved);
124 return (I915_READ_NOTRACE(bus->gpio_reg) & GPIO_CLOCK_VAL_IN) != 0;
129 struct intel_gmbus *bus = data;
130 struct drm_i915_private *dev_priv = bus->dev_priv;
131 u32 reserved = get_reserved(bus);
132 I915_WRITE_NOTRACE(bus->gpio_reg, reserved | GPIO_DATA_DIR_MASK);
133 I915_WRITE_NOTRACE(bus->gpio_reg, reserved);
134 return (I915_READ_NOTRACE(bus->gpio_reg) & GPIO_DATA_VAL_IN) != 0;
139 struct intel_gmbus *bus = data;
140 struct drm_i915_private *dev_priv = bus->dev_priv;
141 u32 reserved = get_reserved(bus);
150 I915_WRITE_NOTRACE(bus->gpio_reg, reserved | clock_bits);
151 POSTING_READ(bus->gpio_reg);
156 struct intel_gmbus *bus = data;
157 struct drm_i915_private *dev_priv = bus->dev_priv;
158 u32 reserved = get_reserved(bus);
167 I915_WRITE_NOTRACE(bus->gpio_reg, reserved | data_bits);
168 POSTING_READ(bus->gpio_reg);
174 struct intel_gmbus *bus = container_of(adapter,
177 struct drm_i915_private *dev_priv = bus->dev_priv;
181 set_data(bus, 1);
182 set_clock(bus, 1);
190 struct intel_gmbus *bus = container_of(adapter,
193 struct drm_i915_private *dev_priv = bus->dev_priv;
195 set_data(bus, 1);
196 set_clock(bus, 1);
201 intel_gpio_setup(struct intel_gmbus *bus, u32 pin)
203 struct drm_i915_private *dev_priv = bus->dev_priv;
206 algo = &bus->adapter;
209 bus->gpio_reg = dev_priv->gpio_mmio_base + gmbus_ports[pin - 1].reg;
211 bus->adapter.algo_data = algo;
225 algo->data = bus;
408 struct intel_gmbus *bus = container_of(adapter,
411 struct drm_i915_private *dev_priv = bus->dev_priv;
417 if (bus->force_bit) {
424 I915_WRITE(GMBUS0 + reg_offset, bus->reg0);
449 /* Generate a STOP condition on the bus. Note that gmbus can't generata
470 * Wait for bus to IDLE before clearing NAK.
471 * If we clear the NAK while bus is still active, then it will stay
505 bus->adapter.name, bus->reg0 & 0xff);
509 bus->force_bit = 1;
549 struct intel_gmbus *bus = &dev_priv->gmbus[i];
552 snprintf(bus->adapter.name,
553 sizeof(bus->adapter.name),
557 // bus->adapter.dev.parent = &dev->pdev->dev;
558 bus->dev_priv = dev_priv;
560 bus->adapter.algo = &gmbus_algorithm;
563 bus->reg0 = port | GMBUS_RATE_100KHZ;
567 bus->force_bit = 1;
569 intel_gpio_setup(bus, port);
588 struct intel_gmbus *bus = to_intel_gmbus(adapter);
590 bus->reg0 = (bus->reg0 & ~(0x3 << 8)) | speed;
595 struct intel_gmbus *bus = to_intel_gmbus(adapter);
597 bus->force_bit += force_bit ? 1 : -1;
600 bus->force_bit);
607 struct intel_gmbus *bus = &dev_priv->gmbus[i];
608 // i2c_del_adapter(&bus->adapter);