diff --git a/boards/arm/samv7/common/src/sam_gpio_enc.c b/boards/arm/samv7/common/src/sam_gpio_enc.c index 88aebfe5733..bce43eda6f5 100644 --- a/boards/arm/samv7/common/src/sam_gpio_enc.c +++ b/boards/arm/samv7/common/src/sam_gpio_enc.c @@ -76,6 +76,8 @@ static int sam_gpio_enc_position(struct qe_lowerhalf_s *lower, int32_t *pos); static int sam_gpio_enc_setup(struct qe_lowerhalf_s *lower); static int sam_gpio_enc_shutdown(struct qe_lowerhalf_s *lower); static int sam_gpio_enc_reset(struct qe_lowerhalf_s *lower); +static int sam_gpio_enc_ioctl(struct qe_lowerhalf_s *lower, int cmd, + unsigned long arg); /**************************************************************************** * Private Data @@ -88,7 +90,7 @@ static const struct qe_ops_s g_qecallbacks = .position = sam_gpio_enc_position, .setposmax = NULL, .reset = sam_gpio_enc_reset, - .ioctl = NULL, + .ioctl = sam_gpio_enc_ioctl, }; static struct sam_qeconfig_s sam_gpio_enc_config = @@ -300,6 +302,14 @@ static int sam_gpio_enc_shutdown(struct qe_lowerhalf_s *lower) return OK; } +/**************************************************************************** + * Name: sam_gpio_enc_reset + * + * Description: + * Reset the position measurement to base position. + * + ****************************************************************************/ + static int sam_gpio_enc_reset(struct qe_lowerhalf_s *lower) { struct sam_gpio_enc_lowerhalf_s *priv = @@ -312,6 +322,23 @@ static int sam_gpio_enc_reset(struct qe_lowerhalf_s *lower) return OK; } +/**************************************************************************** + * Name: sam_gpio_enc_ioctl + * + * Description: + * This method is called when IOCTL command can not be handled by upper + * half of the driver. + * + ****************************************************************************/ + +static int sam_gpio_enc_ioctl(struct qe_lowerhalf_s *lower, int cmd, + unsigned long arg) +{ + /* No commands supported. */ + + return -ENOTTY; +} + /**************************************************************************** * Public Functions ****************************************************************************/