Lines Matching refs:ds

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()
132 struct dock_station *ds; in find_dock_station() local
134 list_for_each_entry(ds, &dock_stations, sibling) in find_dock_station()
135 if (ds->handle == handle) in find_dock_station()
136 return ds; in find_dock_station()
150 find_dock_dependent_device(struct dock_station *ds, struct acpi_device *adev) in find_dock_dependent_device() argument
154 list_for_each_entry(dd, &ds->dependent_devices, list) in find_dock_dependent_device()
164 struct dock_station *ds = find_dock_station(dshandle); in register_dock_dependent_device() local
166 if (ds && !find_dock_dependent_device(ds, adev)) in register_dock_dependent_device()
167 add_dock_dependent_device(ds, adev); in register_dock_dependent_device()
207 static int dock_present(struct dock_station *ds) in dock_present() argument
212 if (ds) { in dock_present()
213 status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta); in dock_present()
224 static void hot_remove_dock_devices(struct dock_station *ds) in hot_remove_dock_devices() argument
233 list_for_each_entry_reverse(dd, &ds->dependent_devices, list) in hot_remove_dock_devices()
237 list_for_each_entry_reverse(dd, &ds->dependent_devices, list) in hot_remove_dock_devices()
251 static void hotplug_dock_devices(struct dock_station *ds, u32 event) in hotplug_dock_devices() argument
256 list_for_each_entry(dd, &ds->dependent_devices, list) in hotplug_dock_devices()
260 list_for_each_entry(dd, &ds->dependent_devices, list) in hotplug_dock_devices()
269 list_for_each_entry(dd, &ds->dependent_devices, list) { in hotplug_dock_devices()
281 static void dock_event(struct dock_station *ds, u32 event, int num) in dock_event() argument
283 struct device *dev = &ds->dock_device->dev; in dock_event()
300 list_for_each_entry(dd, &ds->dependent_devices, list) in dock_event()
314 static void handle_dock(struct dock_station *ds, int dock) in handle_dock() argument
321 acpi_handle_info(ds->handle, "%s\n", dock ? "docking" : "undocking"); in handle_dock()
328 status = acpi_evaluate_integer(ds->handle, "_DCK", &arg_list, &value); in handle_dock()
330 acpi_handle_err(ds->handle, "Failed to execute _DCK (0x%x)\n", in handle_dock()
334 static inline void dock(struct dock_station *ds) in dock() argument
336 handle_dock(ds, 1); in dock()
339 static inline void undock(struct dock_station *ds) in undock() argument
341 handle_dock(ds, 0); in undock()
344 static inline void begin_dock(struct dock_station *ds) in begin_dock() argument
346 ds->flags |= DOCK_DOCKING; in begin_dock()
349 static inline void complete_dock(struct dock_station *ds) in complete_dock() argument
351 ds->flags &= ~(DOCK_DOCKING); in complete_dock()
352 ds->last_dock_time = jiffies; in complete_dock()
355 static inline void begin_undock(struct dock_station *ds) in begin_undock() argument
357 ds->flags |= DOCK_UNDOCKING; in begin_undock()
360 static inline void complete_undock(struct dock_station *ds) in complete_undock() argument
362 ds->flags &= ~(DOCK_UNDOCKING); in complete_undock()
373 static int dock_in_progress(struct dock_station *ds) in dock_in_progress() argument
375 if ((ds->flags & DOCK_DOCKING) || in dock_in_progress()
376 time_before(jiffies, (ds->last_dock_time + HZ))) in dock_in_progress()
387 static int handle_eject_request(struct dock_station *ds, u32 event) in handle_eject_request() argument
389 if (dock_in_progress(ds)) in handle_eject_request()
399 dock_event(ds, event, UNDOCK_EVENT); in handle_eject_request()
401 hot_remove_dock_devices(ds); in handle_eject_request()
402 undock(ds); in handle_eject_request()
403 acpi_evaluate_lck(ds->handle, 0); in handle_eject_request()
404 acpi_evaluate_ej0(ds->handle); in handle_eject_request()
405 if (dock_present(ds)) { in handle_eject_request()
406 acpi_handle_err(ds->handle, "Unable to undock!\n"); in handle_eject_request()
409 complete_undock(ds); in handle_eject_request()
425 struct dock_station *ds = find_dock_station(handle); in dock_notify() local
428 if (!ds) in dock_notify()
436 if ((ds->flags & DOCK_IS_DOCK) && event == ACPI_NOTIFY_DEVICE_CHECK) in dock_notify()
451 if (!dock_in_progress(ds) && !acpi_device_enumerated(adev)) { in dock_notify()
452 begin_dock(ds); in dock_notify()
453 dock(ds); in dock_notify()
454 if (!dock_present(ds)) { in dock_notify()
456 complete_dock(ds); in dock_notify()
459 hotplug_dock_devices(ds, event); in dock_notify()
460 complete_dock(ds); in dock_notify()
461 dock_event(ds, event, DOCK_EVENT); in dock_notify()
462 acpi_evaluate_lck(ds->handle, 1); in dock_notify()
466 if (dock_present(ds) || dock_in_progress(ds)) in dock_notify()
474 begin_undock(ds); in dock_notify()
475 if ((immediate_undock && !(ds->flags & DOCK_IS_ATA)) in dock_notify()
477 handle_eject_request(ds, event); in dock_notify()
479 dock_event(ds, event, UNDOCK_EVENT); in dock_notify()
589 struct dock_station *dock_station, ds = { NULL, }; in acpi_dock_add() local
599 pdevinfo.data = &ds; in acpi_dock_add()
600 pdevinfo.size_data = sizeof(ds); in acpi_dock_add()