03 Jun, 2013

4 commits

  • We need to correctly zero-terminate the input to parse it. Otherwise, we
    always end up interpreting it as numbers.
    Furthermore, we actually want hexadecimal numbers instead of decimal. As
    it is a debugfs interface, we can change the API at any time.

    Signed-off-by: David Herrmann
    Signed-off-by: Jiri Kosina

    David Herrmann
     
  • If we write a DRM mode via debugfs, we shouldn't allow normal operations
    to overwrite this DRM mode. This is important if we want to debug
    3rd-party devices and we want to see what data is sent on each mode.

    If we write NULL/0 as DRM, the lock is removed again so the best matching
    DRM is chosen by wiimote core.

    Signed-off-by: David Herrmann
    Signed-off-by: Jiri Kosina

    David Herrmann
     
  • single_open() stores the seq_file pointer in file->private_data. It stores
    our ctx pointer in seq_file->private.

    Signed-off-by: David Herrmann
    Signed-off-by: Jiri Kosina

    David Herrmann
     
  • The hid-wiimote driver supports more than the Wii Remote. Nintendo
    produced many devices based on the Wii Remote, which have extension
    devices built-in. It is not clear to many users, that these devices have
    anything in common with the Wii Remote, so fix the driver description.

    This also updates the copyright information for the coming hotplugging
    rework.

    Signed-off-by: David Herrmann
    Signed-off-by: Jiri Kosina

    David Herrmann
     

18 Jan, 2013

1 commit

  • This variable is initialized conditionally, based on whether a wiimote
    call succeeds. However, the logic is not obvious to the compiler so it
    throws a warning. Eliminate the warning by initializing "size" to 0.

    The warning is:
    files/drivers/hid/hid-wiimote-debug.c:69:18: warning: 'size' may be used
    uninitialized in this function [-Wmaybe-uninitialized]

    Signed-off-by: Simon Que
    Signed-off-by: David Herrmann
    Signed-off-by: Jiri Kosina

    Simon Que
     

06 Apr, 2012

1 commit

  • Many users of debugfs copy the implementation of default_open() when
    they want to support a custom read/write function op. This leads to a
    proliferation of the default_open() implementation across the entire
    tree.

    Now that the common implementation has been consolidated into libfs we
    can replace all the users of this function with simple_open().

    This replacement was done with the following semantic patch:

    @ open @
    identifier open_f != simple_open;
    identifier i, f;
    @@
    -int open_f(struct inode *i, struct file *f)
    -{
    (
    -if (i->i_private)
    -f->private_data = i->i_private;
    |
    -f->private_data = i->i_private;
    )
    -return 0;
    -}

    @ has_open depends on open @
    identifier fops;
    identifier open.open_f;
    @@
    struct file_operations fops = {
    ...
    -.open = open_f,
    +.open = simple_open,
    ...
    };

    [akpm@linux-foundation.org: checkpatch fixes]
    Signed-off-by: Stephen Boyd
    Cc: Greg Kroah-Hartman
    Cc: Al Viro
    Cc: Julia Lawall
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     

23 Nov, 2011

3 commits

  • Keep track of current drm and add new debugfs file which reads or writes the
    current DRM.

    Signed-off-by: David Herrmann
    Signed-off-by: Jiri Kosina

    David Herrmann
     
  • The wiimote provides direct access to parts of its eeprom. This implements read
    support for small chunks of the eeprom. This isn't very fast but prevents the
    reader from blocking the wiimote stream for too long.

    Write support is not yet supported as the wiimote breaks if we overwrite its
    memory. Use hidraw to reverse-engineer the eeprom before implementing write
    support here.

    Signed-off-by: David Herrmann
    Signed-off-by: Jiri Kosina

    David Herrmann
     
  • Add initializer and deinitializer for debugfs support. This will later allow raw
    eeprom access and direct DRM modifications to debug wiimote behaviour and
    further protocol reverse-engineerings.

    Signed-off-by: David Herrmann
    Signed-off-by: Jiri Kosina

    David Herrmann