This driver supports: - reading channels in 'one shot' mode through read_raw callback, - three events - rising and falling ambient light events and rising proximity event. - triggers for all three channels (ambient light related triggers can't be enabled simultaneosly with proxmity detection event) This is a follow-up of the previous patch and it includes following improvements (Jonathan and Lars - thanks for the review) - corrected name of the driver (gp2ap002a00f -> gp2ap020a00f) - removed available_scan_masks - all scan modes can be enabled in the same time, but a solution is needed for preventing from enabling ambient light related scan modes when proxmity detection event is enabled - fixed mode subtraction bug in the gp2ap020a00f_alter_opmode - passing correct enums to the gp2ap002a00f_set_operation_mode in the first three cases of the switch in gp2ap002a00f_exec_cmd - fixed distinguishing between rising and falling ambient light events in the gp2ap020a00f_event_handler - added call to iio_trigger_poll in the gp2ap020a00f_event_handler for firing off trigger consumer interrupts - fixed filling a buffer with a timestamp in the gp2ap020a00f_trigger_handler - added namespacing where Lars-Peter Clausen requested - fixed buffer allocaton - moved it from trigger irq handler to the gp2ap020a00f_buffer_preenable callback - improved gp2ap020a00f_buffer_predisable callback - added buffer allocation and trigger registration - switched from devm_request_threaded_irq to its "no-devm" counterpart - removed superfluous debug logging TODO: - switch from reg_cache to regmap framework usage - will be addressed in the next version of this patch Issues: - WARNING: at kernel/irq/handle.c:146 on call to - How to notify a user that ambient light related scan modes cannot be enabled simultaneosly with proximity detection event? - "module in use" issue on rmmod Jacek Anaszewski (1): iio: gp2ap020a00f: Add a driver for the device .../devicetree/bindings/iio/light/gp2ap020a00f.txt | 20 + drivers/iio/light/Kconfig | 12 + drivers/iio/light/Makefile | 1 + drivers/iio/light/gp2ap020a00f.c | 1193 ++++++++++++++++++++ 4 files changed, 1226 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt create mode 100644 drivers/iio/light/gp2ap020a00f.c -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html