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