Skip to content

Commit

Permalink
Bug 1276927: Add V4L ioctl 'VIDIOC_S_HW_FREQ_SEEK' if undefined by Li…
Browse files Browse the repository at this point in the history
…nux, r=gsvelto

MozReview-Commit-ID: 5ZvrhwOyfYy
  • Loading branch information
tdz committed Jun 15, 2016
1 parent 5693604 commit 652b70f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions hal/gonk/GonkFMRadio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
#include <sys/stat.h>
#include <sys/types.h>


/* Bionic might not have the newer version of the v4l2 headers that
* define these controls, so we define them here if they're not found.
*/

#ifndef V4L2_CTRL_CLASS_FM_RX
#define V4L2_CTRL_CLASS_FM_RX 0x00a10000
#define V4L2_CID_FM_RX_CLASS_BASE (V4L2_CTRL_CLASS_FM_RX | 0x900)
Expand Down Expand Up @@ -60,6 +60,20 @@ struct v4l2_rds_data {
#define V4L2_RDS_BLOCK_ERROR 0x80
#endif

#ifndef VIDIOC_S_HW_FREQ_SEEK
struct v4l2_hw_freq_seek {
__u32 tuner;
__u32 type;
__u32 seek_upward;
__u32 wrap_around;
__u32 spacing;
__u32 rangelow;
__u32 rangehigh;
__u32 reserved[5];
};
#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
#endif

namespace mozilla {
namespace hal_impl {

Expand Down Expand Up @@ -263,7 +277,7 @@ runMsmFMRadio(void *)
for (unsigned int i = 0; i < buffer.bytesused; i++) {
switch (buf[i]) {
case TAVARUA_EVT_RADIO_READY:
// The driver sends RADIO_READY both when we turn the radio on and when we turn
// The driver sends RADIO_READY both when we turn the radio on and when we turn
// the radio off.
if (sRadioEnabled) {
NS_DispatchToMainThread(new RadioUpdate(hal::FM_RADIO_OPERATION_ENABLE,
Expand Down

0 comments on commit 652b70f

Please sign in to comment.