Lines Matching refs:ds

66  * @ds: Dock station.
71 static int add_dock_dependent_device(struct dock_station *ds,
82 list_add_tail(&dd->list, &ds->dependent_devices);
118 struct dock_station *ds;
120 list_for_each_entry(ds, &dock_stations, sibling)
121 if (ds->handle == handle)
122 return ds;
129 * @ds: the dock station
136 find_dock_dependent_device(struct dock_station *ds, struct acpi_device *adev)
140 list_for_each_entry(dd, &ds->dependent_devices, list)
150 struct dock_station *ds = find_dock_station(dshandle);
152 if (ds && !find_dock_dependent_device(ds, adev))
153 add_dock_dependent_device(ds, adev);
188 * @ds: the dock station
193 static int dock_present(struct dock_station *ds)
198 if (ds) {
199 status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta);
208 * @ds: Dock station.
210 static void hot_remove_dock_devices(struct dock_station *ds)
219 list_for_each_entry_reverse(dd, &ds->dependent_devices, list)
223 list_for_each_entry_reverse(dd, &ds->dependent_devices, list)
229 * @ds: the dock station
237 static void hotplug_dock_devices(struct dock_station *ds, u32 event)
242 list_for_each_entry(dd, &ds->dependent_devices, list)
246 list_for_each_entry(dd, &ds->dependent_devices, list)
255 list_for_each_entry(dd, &ds->dependent_devices, list) {
267 static void dock_event(struct dock_station *ds, u32 event, int num)
269 struct device *dev = &ds->dock_device->dev;
286 list_for_each_entry(dd, &ds->dependent_devices, list)
295 * @ds: the dock station
300 static void handle_dock(struct dock_station *ds, int dock)
307 acpi_handle_info(ds->handle, "%s\n", dock ? "docking" : "undocking");
314 status = acpi_evaluate_integer(ds->handle, "_DCK", &arg_list, &value);
316 acpi_handle_err(ds->handle, "Failed to execute _DCK (0x%x)\n",
320 static inline void dock(struct dock_station *ds)
322 handle_dock(ds, 1);
325 static inline void undock(struct dock_station *ds)
327 handle_dock(ds, 0);
330 static inline void begin_dock(struct dock_station *ds)
332 ds->flags |= DOCK_DOCKING;
335 static inline void complete_dock(struct dock_station *ds)
337 ds->flags &= ~(DOCK_DOCKING);
338 ds->last_dock_time = jiffies;
341 static inline void begin_undock(struct dock_station *ds)
343 ds->flags |= DOCK_UNDOCKING;
346 static inline void complete_undock(struct dock_station *ds)
348 ds->flags &= ~(DOCK_UNDOCKING);
353 * @ds: the dock station
359 static int dock_in_progress(struct dock_station *ds)
361 if ((ds->flags & DOCK_DOCKING) ||
362 time_before(jiffies, (ds->last_dock_time + HZ)))
369 * @ds: The dock station to undock.
375 static int handle_eject_request(struct dock_station *ds, u32 event)
377 if (dock_in_progress(ds))
387 dock_event(ds, event, UNDOCK_EVENT);
389 hot_remove_dock_devices(ds);
390 undock(ds);
391 acpi_evaluate_lck(ds->handle, 0);
392 acpi_evaluate_ej0(ds->handle);
393 if (dock_present(ds)) {
394 acpi_handle_err(ds->handle, "Unable to undock!\n");
397 complete_undock(ds);
413 struct dock_station *ds = find_dock_station(handle);
416 if (!ds)
424 if ((ds->flags & DOCK_IS_DOCK) && event == ACPI_NOTIFY_DEVICE_CHECK)
439 if (!dock_in_progress(ds) && !acpi_device_enumerated(adev)) {
440 begin_dock(ds);
441 dock(ds);
442 if (!dock_present(ds)) {
444 complete_dock(ds);
447 hotplug_dock_devices(ds, event);
448 complete_dock(ds);
449 dock_event(ds, event, DOCK_EVENT);
450 acpi_evaluate_lck(ds->handle, 1);
454 if (dock_present(ds) || dock_in_progress(ds))
462 begin_undock(ds);
463 if ((immediate_undock && !(ds->flags & DOCK_IS_ATA))
465 handle_eject_request(ds, event);
467 dock_event(ds, event, UNDOCK_EVENT);
577 struct dock_station *dock_station, ds = { NULL, };
587 pdevinfo.data = &ds;
588 pdevinfo.size_data = sizeof(ds);