Commit graph

63049 commits

Author SHA1 Message Date
Laurent Pinchart
0eaa3d82d4 media: staging: media: imx: imx7-media-csi: Make default formats consistent
Use the same default image width and height for both the CSI subdev and
the video node to achieve a consistent default through the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:03:00 +01:00
Laurent Pinchart
1de014dc6b media: staging: media: imx: imx7-media-csi: Drop unsupported YUV and RGB formats
A large number of formats defined in the pixel_formats array are not
supported, as shown by the switch-case check in
imx7_csi_pad_link_validate(). Drop them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:59 +01:00
Laurent Pinchart
6ad52b675f media: staging: media: imx: imx7-media-csi: Drop IPU-only formats
The formats specific to the IPUv3 are not supported by the CSI bridge.
Drop them, along with the related code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:58 +01:00
Laurent Pinchart
44737d2ac4 media: staging: media: imx: imx7-media-csi: Drop IC support from imx7_csi_try_colorimetry()
The imx7_csi_try_colorimetry() function supports the unrelated image
converter hardware as it originates from shared helpers. Drop that.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:57 +01:00
Laurent Pinchart
a61bfe6625 media: staging: media: imx: imx7-media-csi: Replace ipu_color_space with bool yuv field
Replace the enum ipu_color_space cs field in struct imx7_csi_pixfmt with
a bool yuv field. This decouples the driver from the unrelated IPUv3
headers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:56 +01:00
Laurent Pinchart
e352833d32 media: staging: media: imx: imx7-media-csi: Import format helpers
To prepare for code refactoring, copy the format helpers used by this
driver from imx-media-utils.c. Rename structures and functions to avoid
name clashes, no functional change intended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:55 +01:00
Laurent Pinchart
35b53d44e1 media: staging: media: imx: imx7-media-csi: Drop error message on alloc failure
The kernel memory allocators already complain loudly to the log when
allocation fails. There's no need for an additional message.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:54 +01:00
Laurent Pinchart
56ae4cac6d media: staging: media: imx: imx7-media-csi: Decouple from shared macros
Decouple from the IMX7_CSI_VIDEO_DEF_PIX_WIDTH,
IMX7_CSI_VIDEO_DEF_PIX_HEIGHT and IMX_MEDIA_EOF_TIMEOUT macros defined
in shared helpers by duplicating them in the imx7-media-csi driver, with
a rename to avoid name clashes. No functional change intended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:53 +01:00
Laurent Pinchart
57327b0824 media: staging: media: imx: imx7-media-csi: Decouple from imx_media_dma_buf
Decouple from the imx_media_dma_buf structure defined in shared helpers
by duplicating it in the imx7-media-csi driver, along with the two small
alloc and free functions. No functional change intended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:52 +01:00
Laurent Pinchart
0cc432b741 media: staging: media: imx: imx7-media-csi: Store imx7_csi in drv data
Replace the subdev pointer stored in platform drv data with the imx7_csi
pointer. Drop a now redundant dev_set_drvdata() call.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:51 +01:00
Laurent Pinchart
084158200f media: staging: media: imx: imx7-media-csi: Fold imx_media_video_dev into imx7_csi
Now that the driver doesn't use any helper that relies on the
imx_media_video_dev structure anymore, merge its fields directly in the
imx7_csi structure. Update all the users accordingly, and drop the list
field that isn't used by the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:50 +01:00
Laurent Pinchart
1f55211b1b media: staging: media: imx: imx7-media-csi: Decouple from imx_media_buffer
Decouple from the imx_media_buffer structure defined in shared helpers
by duplicating it in the imx7-media-csi driver. No functional change
intended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:49 +01:00
Laurent Pinchart
b6ae101900 media: staging: media: imx: imx7-media-csi: Fold imx_media_dev into imx7_csi
Now that the driver doesn't use any helper that relies on the
imx_media_dev structure anymore, merge the three fields of the
imx_media_dev structure directly in the imx7_csi structure. Update all
the users accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:48 +01:00
Laurent Pinchart
f5c673428b media: staging: media: imx: imx7-media-csi: Inline pipeline start/stop
The imx7_csi_media_pipeline_set_stream() function has separate branches
for the start and stop paths, surrounded by mutex lock/unlock. That is
very little shared code, inline the locking and corresponding branch in
each of the two callers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:48 +01:00
Laurent Pinchart
a3ec6bc1af media: staging: media: imx: imx7-media-csi: Avoid unnecessary casts
Simplify the imx7_csi_media_pipeline_set_stream() function by passing it
the imx7_csi pointer, which avoids going from subdev to entity and back
to subdev.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:47 +01:00
Laurent Pinchart
9d75fc9917 media: staging: media: imx: imx7-media-csi: Import imx_media_pipeline_set_stream()
To prepare for code refactoring, copy the
imx_media_pipeline_set_stream() helper used by this driver from
imx-media-utils.c. Rename the function to avoid name clashes, no
functional change intended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:46 +01:00
Laurent Pinchart
7d3bee233c media: staging: media: imx: imx7-media-csi: Inline imx_media_pipeline_pad()
Inline the imx_media_pipeline_pad() helper, dropping all the code unused
by the imx7-media-csi driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:45 +01:00
Laurent Pinchart
3777d61b2b media: staging: media: imx: imx7-media-csi: Don't initialize unused fields
The imx_media_dev structure contains three fields that are not used by
this driver or any helper code that it calls. Don't initialize them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:44 +01:00
Laurent Pinchart
55eb173fe2 media: staging: media: imx: imx7-media-csi: Drop imx_media_add_video_device call
There's no need to call imx_media_add_video_device() anymore, as the
video devices list it manages is only used by the control inheritance
mechanism in the helpers, which this driver doesn't use.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:43 +01:00
Laurent Pinchart
23bcc91082 media: staging: media: imx: imx7-media-csi: Embed imx_media_dev in imx7_csi
There's no need anymore to allocate the imx_media_dev structure
separately from imx7_csi. Embed it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:42 +01:00
Laurent Pinchart
1ab24f2e24 media: staging: media: imx: imx7-media-csi: Import imx_media_dev_init() helper
To prepare for code refactoring, copy the imx_media_dev_init() helper
used by this driver from imx-media-dev-common.c. Rename the function to
avoid name clashes, and leave the v4l2_device notify handler out as it
only serves to implement control inheritance, which this driver doesn't
use. No functional change intended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:41 +01:00
Laurent Pinchart
be3e378b2d media: staging: media: imx: imx7-media-csi: Don't set subdev group id
The subdev group id isn't used by any of the remaining helpers used by
this driver, don't set it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:40 +01:00
Laurent Pinchart
31959b981c media: staging: media: imx: imx7-media-csi: Ensure consistent function prefix
Rename all the functions and macros imported from imx-media-capture.c
with a consistent imx7_csi_video_ prefix. No functional change intended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:40 +01:00
Laurent Pinchart
9f10ecffac media: staging: media: imx: imx7-media-csi: Fold capture_priv into imx7_csi
Merge the capture_priv fields in the imx7_csi structure as there's no
more need to have two separate structures. Update all the users
accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:38 +01:00
Laurent Pinchart
356345aaed media: staging: media: imx: imx7-media-csi: Reorganize imx7_csi structure
The struct imx7_csi fields are in a random order, reorganize them
logically to prepare for adding new fields.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:37 +01:00
Laurent Pinchart
42bfdc8249 media: staging: media: imx: imx7-media-csi: Drop unused controls support
Drop the unused control handler from the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:37 +01:00
Laurent Pinchart
49b74aa523 media: staging: media: imx: imx7-media-csi: Drop legacy video device support
Drop all the code related to the unused (by this driver) legacy video
device support.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:36 +01:00
Laurent Pinchart
01ac6b7542 media: staging: media: imx: imx7-media-csi: Import video device helpers
To prepare for code refactoring, copy the video device helper code used
by this driver verbatim from imx-media-capture. Rename some functions to
avoid name clashes, and leave the legacy ioctls out as they're not used
by the imx7-media-csi driver. No functional change included.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:35 +01:00
Paul Elder
08b1fedddf media: staging: media: imx: imx7-media-csi: Remove imx_media_of_add_csi
imx_media_of_add_csi() from imx-media-of.c validates that the fwnode for
the CSI bridge is enabled, and adds the fwnode to the async notifier of
the imxmd. The former is redundant, as if the CSI bridge driver probes,
clearly it is enabled in the DT. The latter is not needed as the imxmd
notifier isn't used anymore. The call is thus not needed and can be
dropped. This removes the dependency of imx7-media-csi.c on
imx-media-of.c.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:33 +01:00
Laurent Pinchart
8ace5084d1 media: staging: media: imx: imx7-media-csi: Move format init to probe time
There's no need to wait until the subdev is registered to initialize the
active pad formats. Do so at probe time.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:32 +01:00
Laurent Pinchart
85f8673fa1 media: staging: media: imx: imx7-media-csi: Drop unused frame_interval
The frame_interval field of the imx7_csi structure is set but never
used. Drop it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:32 +01:00
Laurent Pinchart
46332d14eb media: staging: media: imx: imx7-media-csi: Don't populate vdev lists
The imx_media_dev framework maintains a per-pad list of connected video
devices, created once all subdevs have been bound. This is used for two
purposes, updating V4L2 control inheritance when links change, and
relaying subdev events to video nodes. None of these are used by the
imx7-media-csi driver as it implements the MC-centric approach. Drop
them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:31 +01:00
Paul Elder
f9806bd2b4 media: staging: media: imx: imx7-media-csi: Move misc init out of probe()
There is a chunk of miscellaneous initializations related to the CSI
subdev and media pads directly in the probe function. Move them into the
imx7_csi_media_init() function to clean up the probe function.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:30 +01:00
Laurent Pinchart
d79d5e00be media: staging: media: imx: imx7-media-csi: Drop the imx_media notifier
The V4L2 async notifier embedded in the imx_media_dev structure is
triggered when the CSI bridge subdev is registered. We don't need an
async notifier for this, as we can call the .complete() handler directly
from the CSI bridge subdev .registered() handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:29 +01:00
Laurent Pinchart
3c05e2dd4f media: staging: media: imx: imx7-media-csi: Drop duplicate link creation
The imx_media_create_csi2_links() creates a media controller link
between the CSI-2 receiver and the next entity in the pipeline, which
can be either a video mux (handled by the video-mux driver) or the CSI
bridge itself. This isn't needed, as the link is already created either
by the video-mux driver or by the imx7-media-csi driver itself (in
imx7_csi_notify_bound()).

Drop imx_media_create_csi2_links(), which allows dropping the CSI bridge
subdev grp_id.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:28 +01:00
Laurent Pinchart
bdf861aba4 media: staging: media: imx: imx7-media-csi: Import notifier helpers
To prepare for code refactoring, copy the V4L2 async notifier helper
code used by this driver verbatim from imx-media-dev-common.c. Rename
some functions to avoid name clashes. No functional change included.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:27 +01:00
Laurent Pinchart
a314327c9d media: staging: media: imx: imx7-media-csi: Split imx_media_dev from probe()
Prepare for the decoupling of the imx7-media-csi driver from the
IPUv3-based drivers by moving the imx_media_dev handling from probe()
function to separate functions.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:26 +01:00
Laurent Pinchart
34d868e862 media: staging: media: imx: imx7-media-csi: Initialize locks early on
Group all the direct initialization of imx7_csi fields at the beginning
of the imx7_csi_probe() function instead of spreading them around.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 18:02:25 +01:00
Li zeming
f064f018a8 media: staging/media/atomisp/pci/atomisp: Fix typo in string
Remove the repeated ',' from string

Link: https://lore.kernel.org/linux-media/20220704022807.3215-1-zeming@nfschina.com
Signed-off-by: Li zeming <zeming@nfschina.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:49:47 +01:00
Colin Ian King
71074d3783 media: atomisp: clean up for-loop, remove redundant assignment to variable i
There is a for-loop that initializes variable i but does not use it; the
assignment is redundant and can be removed. The proceeding assignment to
pointer fw can also be moved into the for-loop to clean up the code.

Link: https://lore.kernel.org/linux-media/20220628152451.184416-1-colin.i.king@gmail.com
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:49:27 +01:00
Karthik Alapati
faf5b7971a media: staging: media/atomisp: use max() impl
fix a coccinelle warning by replacing opencoded max()
implementation with max()

WARNING opportunity for max()

Link: https://lore.kernel.org/linux-media/YrNFpF2qvTxpZP8e@karthik-strix-linux.karthek.com
Signed-off-by: Karthik Alapati <mail@karthek.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:47:54 +01:00
Jiang Jian
871f13fe12 media: atomisp: Fix typo in comments
Remove the repeated word 'and' from comments

file: drivers/staging/media/atomisp/pci/hive_isp_css_include/host/debug_public.h
line: 28

* The buffer has a remote and and a local store

changed to:

* The buffer has a remote and a local store

Link: https://lore.kernel.org/linux-media/20220622143442.16942-1-jiangjian@cdjrlc.com
Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:47:31 +01:00
Ard Biesheuvel
0c122ad91f media: atomisp_gmin_platform: stop abusing efivar API
As the code comment already suggests, using the efivar API in this way
is not how it is intended, and so let's switch to the right one, which
is simply to call efi.get_variable() directly after checking whether or
not the GetVariable() runtime service is supported.

Link: https://lore.kernel.org/linux-media/20220620100819.1682995-1-ardb@kernel.org
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:47:11 +01:00
Hans de Goede
1713dceb57 media: atomisp: fix -Wdangling-pointer warning
ia_css_rmgr_acq_vbuf() uses a local on stack
"struct ia_css_rmgr_vbuf_handle v" variable.

When this path using this is hit, either the rmgr_pop_handle() call
will make *handle point to another vbuf-handle, or because
v.count == 0, ia_css_rmgr_refcount_retain_vbuf() will alloc a new
vbuf-handle and make *handle point to it.

So on leaving the function *handle will never point to the on stack
vbuf-handle, but gcc does not know this and emits the following:

drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c: In function ‘ia_css_rmgr_acq_vbuf’:
drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c:276:33: warning: storing the address of local variable ‘h’ in ‘*handle’ [-Wdangling-pointer=]
  276 |                         *handle = &h;
      |                         ~~~~~~~~^~~~
drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c:257:40: note: ‘h’ declared here
  257 |         struct ia_css_rmgr_vbuf_handle h;
      |                                        ^
drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c:257:40: note: ‘handle’ declared here

Rework the code using a new_handle helper to suppress this
false-postive compiler warning.

Link: https://lore.kernel.org/linux-media/20220612160556.108264-4-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:46:27 +01:00
Hans de Goede
42ec2f0714 media: atomisp: fix uninitialized stack mem usage in ia_css_rmgr_acq_vbuf()
When ia_css_rmgr_acq_vbuf() enters the code path where it uses the local
"struct ia_css_rmgr_vbuf_handle v" on the stack it relies on v.count==0
so that ia_css_rmgr_refcount_retain_vbuf allocates a new handle.

Explicitly set v.count to 0 rather then it being whatever was on the stack.

Link: https://lore.kernel.org/linux-media/20220612160556.108264-3-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:44:52 +01:00
Hans de Goede
a3b36a8ce3 media: atomisp: revert "don't pass a pointer to a local variable"
The gcc is warning about returning a pointer to a local variable
is a false positive.

The type of handle is "struct ia_css_rmgr_vbuf_handle **" and
"h.vptr" is left to NULL, so the "if ((*handle)->vptr == 0x0)"
check always succeeds when the "*handle = &h;" statement which
gcc warns about executes. Leading to this statement being executed:

	rmgr_pop_handle(pool, handle);

If that succeeds,  then *handle has been set to point to one of
the pre-allocated array of handles, so it no longer points to h.

If that fails the following statement will be executed:

	/* Note that handle will change to an internally maintained one */
	ia_css_rmgr_refcount_retain_vbuf(handle);

Which allocated a new handle from the array of pre-allocated handles
and then makes *handle point to this. So the address of h is actually
never returned.

The fix for the false-postive compiler warning actually breaks the code,
the new:

	**handle = h;

is part of a "if (pool->copy_on_write) { ... }" which means that the
handle where *handle points to should be treated read-only, IOW
**handle must never be set, instead *handle must be set to point to
a new handle (with a copy of the contents of the old handle).

The old code correctly did this and the new fixed code gets this wrong.

Note there is another patch in this series, which fixes the warning
in another way.

Link: https://lore.kernel.org/linux-media/20220612160556.108264-2-hdegoede@redhat.com
Fixes: fa1451374e ("media: atomisp: don't pass a pointer to a local variable")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:44:31 +01:00
Haowen Bai
3823112381 media: atomisp-mt9m114: Fix pointer dereferenced before checking
The info->data is dereferencing before null checking, so move
it after checking.

Link: https://lore.kernel.org/linux-media/1653897481-25681-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Reviewed-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:38:35 +01:00
Xiaomeng Tong
09b204eb9d media: [PATCH] pci: atomisp_cmd: fix three missing checks on list iterator
The three bugs are here:
	__func__, s3a_buf->s3a_data->exp_id);
	__func__, md_buf->metadata->exp_id);
	__func__, dis_buf->dis_data->exp_id);

The list iterator 's3a_buf/md_buf/dis_buf' will point to a bogus
position containing HEAD if the list is empty or no element is found.
This case must be checked before any use of the iterator, otherwise
it will lead to a invalid memory access.

To fix this bug, add an check. Use a new variable '*_iter' as the
list iterator, while use the old variable '*_buf' as a dedicated
pointer to point to the found element.

Link: https://lore.kernel.org/linux-media/20220414041415.3342-1-xiam0nd.tong@gmail.com
Cc: stable@vger.kernel.org
Fixes: ad85094b29 ("Revert "media: staging: atomisp: Remove driver"")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:38:08 +01:00
Fabio M. De Francesco
ce2203e7d6 media: staging: media: atomisp: Use kmap_local_page() in hmm_store()
The use of kmap() is being deprecated in favor of kmap_local_page()
where it is feasible. The same is true for kmap_atomic().

In file pci/hmm/hmm.c, function hmm_store() test if we are in atomic
context and, if so, it calls kmap_atomic(), if not, it calls kmap().

First of all, in_atomic() shouldn't be used in drivers. This macro
cannot always detect atomic context; in particular, it cannot know
about held spinlocks in non-preemptible kernels.

Notwithstanding what it is said above, this code doesn't need to care
whether or not it is executing in atomic context. It can simply use
kmap_local_page() / kunmap_local() that can instead do the mapping /
unmapping regardless of the context.

With kmap_local_page(), the mapping is per thread, CPU local and not
globally visible. Therefore, hmm_store()() is a function where the use
of kmap_local_page() in place of both kmap() and kmap_atomic() is
correctly suited.

Convert the calls of kmap() / kunmap() and kmap_atomic() /
kunmap_atomic() to kmap_local_page() / kunmap_local() and drop the
unnecessary tests which test if the code is in atomic context.

Link: https://lore.kernel.org/linux-media/20220413225531.9425-1-fmdefrancesco@gmail.com
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:35:42 +01:00
Fabio M. De Francesco
aab1c42a9d media: staging: media: atomisp: Use kmap_local_page() in hmm_set()
The use of kmap() is being deprecated in favor of kmap_local_page()
where it is feasible. In file pci/hmm/hmm.c, function hmm_set() calls
kmap() / kunmap() where kmap_local_page() can instead do the mapping.

With kmap_local_page(), the mapping is per thread, CPU local and not
globally visible. Therefore, hmm_set()() is a function where the use
of kmap_local_page() in place of kmap() is correctly suited.

Convert the calls of kmap() / kunmap() to kmap_local_page() /
kunmap_local().

Link: https://lore.kernel.org/linux-media/20220413212210.18494-1-fmdefrancesco@gmail.com
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:34:07 +01:00
Fabio M. De Francesco
2ad935a15f media: staging: media: atomisp: Convert kmap() to kmap_local_page()
The use of kmap() is being deprecated in favor of kmap_local_page() where
it is feasible. With kmap_local_page(), the mapping is per thread, CPU
local and not globally visible.

load_and_flush_by_kmap() is a function where the use of kmap_local_page()
in place of kmap() is correctly suited.

Convert load_and_flush_by_kmap() from kmap() to kmap_local_page().

Link: https://lore.kernel.org/linux-media/20220408223129.3844-1-fmdefrancesco@gmail.com
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 17:32:10 +01:00
Tom Rix
5088bbde3a media: staging: atomisp: rework reading the id and revision values
Clang static analysis reports this representative issue
atomisp-ov2722.c:920:3: warning: 3rd function call
  argument is an uninitialized value
  dev_err(&client->dev, "sensor_id_high = 0x%x\n", high);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

high and low are only set when ov2722_read_reg() is successful.
Reporting the high value when there is an error is not
meaningful.  The later read for low is not checked.  high
and low are or-ed together and checked against a non zero
value.

Remove the unneeded error reporting for high.  Initialize
high and low to 0 and use the id check to determine if
the reads were successful

The later read for revision is not checked.  If it
fails the old high value will be used and the revision
will be misreported.

Since the revision is only reported and not checked or
stored it is not necessary to return if the read with
successful.  This makes the ret variable unnecessary
so remove it.

Link: https://lore.kernel.org/linux-media/20220326191853.2914552-1-trix@redhat.com
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:43:43 +01:00
Hans de Goede
9799a3bf8a media: atomisp: Add a notes.txt file
Add a files documenting what I've learned about the driver while
working on various cleanups.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-41-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:38:25 +01:00
Hans de Goede
b74196e798 media: atomisp: remove force argument from __destroy_[stream[s]|pipe[s]]()
The force argument to the __destroy_pipe[s]() and __destroy_stream[s]()
functions is always true. Remove the argument and remove the code necessary
to handle the false case.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-40-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:38:14 +01:00
Hans de Goede
1341bc9e99 media: atomisp: use atomisp_destroy_pipes_stream_force() in more places
Use atomisp_destroy_pipes_stream_force() in 4 more places,
instead of open coding it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-39-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:38:13 +01:00
Hans de Goede
318e125ac9 media: atomisp: use atomisp_css_update_stream() in more places
Use atomisp_css_update_stream() in 2 more places,
instead of open coding it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-38-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:38:12 +01:00
Hans de Goede
507e72a2ae media: atomisp: use atomisp_create_pipes_stream() in more places
Use atomisp_create_pipes_stream() in 2 more places,
instead of open coding it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-37-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:38:11 +01:00
Hans de Goede
8c341d05a6 media: atomisp: add error logging to atomisp_destroy_pipes_stream_force()
__destroy_streams() and __destroy_pipes() may return an error.
Log a warning when either of them fails.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-36-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:38:11 +01:00
Hans de Goede
798d2ad739 media: atomisp: add error checking to atomisp_create_pipes_stream()
The functions called by atomisp_create_pipes_stream() can fail,
add error checking for them.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-35-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:38:10 +01:00
Hans de Goede
3bde235bf6 media: atomisp: fix __get_frame_info() error handling
On ia_css_pipe_get_info() errors, destroy both the streams as well
as the pipes which were created.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-34-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:38:08 +01:00
Hans de Goede
3a68900a0c media: atomisp: remove hmm_page_object
hmm_page_object only stores a struct page pointer, so we can just use
the hmm_bo.pages page pointer array everywhere.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-33-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:38:07 +01:00
Hans de Goede
f9599127dd media: atomisp: drop HMM_BO_SHARE type
HMM_BO_SHARE is not supported by the hmm_bo code at all, drop it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-32-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:33:21 +01:00
Hans de Goede
975c343f85 media: atomisp: drop highmem var/arg from the hmm code
highmem is always false, drop it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-31-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:33:20 +01:00
Hans de Goede
4cc20c9cdd media: atomisp: Simplify hmm_alloc() calls
Make hmm_alloc() only take size as a parameter and remove other parameters.
since all callers always pass the same flags.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-30-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:33:19 +01:00
Hans de Goede
ceff4bdb60 media: atomisp: add hmm_create_from_userdata() helper
Most hmm_alloc() callers want BO_PRIVATE type memory.

Add a hmm_create_from_userdata() helper for other cases so that
the hmm_alloc() calls for all the callers who don't want this
can be simplied.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-29-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:23:35 +01:00
Hans de Goede
a9796c7b47 media: atomisp: remove unused hmm address translation functions
hmm_isp_vaddr_to_host_vaddr() and hmm_host_vaddr_to_hrt_vaddr()
are unused, remove them.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-28-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:23:33 +01:00
Hans de Goede
9061231732 media: atomisp: drop unused ATOMISP_MAP_FLAG_* flags
Drop the ATOMISP_MAP_FLAG_CACHED flag, it is never set anywhere;
also drop the matching "cached" parameter to hmm[_bo]_alloc which
value was derived form the never set flag.

Drop the ATOMISP_MAP_FLAG_NOFLUSH, it is not used anywhere.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-27-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:57 +01:00
Hans de Goede
9f40d3a79d media: atomisp: drop ATOMISP_MAP_FLAG_CLEARED
This flag is only used by one hmm_alloc() caller, drop it and make
the caller call hmm_set(ptr, 0, size) itself to do the clearing.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-26-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:55 +01:00
Hans de Goede
2c19beb23d media: atomisp: drop unused ATOMISP_ACC_FW_LOAD_* defines
Drop the ATOMISP_ACC_FW_LOAD_* defines, these are no longer used anywhere.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-25-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:54 +01:00
Hans de Goede
54c15ddd4c media: atomisp: remove atomisp_is_acc_enabled()
atomisp_is_acc_enabled() always returns false now, remove it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-24-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:53 +01:00
Hans de Goede
3af445e66f media: atomisp: remove no longer used atomisp_css_acc_done() function
atomisp_css_acc_done() is no longer used anywhere, remove it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-23-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:51 +01:00
Hans de Goede
b717c5175a media: atomisp: asc.acc.pipeline is always NULL
With the removal of the ACC ioctls and atomisp_acc.c asc.acc.pipeline
never gets set, so it is always NULL.

Remove asc.acc.pipeline and drop checks for it being NULL / !NULL.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-22-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:50 +01:00
Hans de Goede
16d6a34503 media: atomisp: remove unused atomisp_*css_* functions
With the removal of the ACC ioctls and atomisp_acc.c a whole bunch
of atomisp_*css_* functions is no longer used, remove them.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-21-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:48 +01:00
Hans de Goede
868088a061 media: atomisp: remove atomisp_acc.c
With the ACC ioctls removed sd->acc.fw is always empty turning
the atomisp_acc.c code into no-ops, remove it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-20-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:47 +01:00
Hans de Goede
4bbca788b6 media: atomisp: remove private acceleration ioctls
These ioctls allow userspace to load custom programs into the ISP, which:

a) Seems dangerous
b) Cannot be used by opensource userspace since there is no FOSS code to
   create such programs
b) These seem to be unused even by the Android closed source camera code
   (they don't show up in a strace of the camera app)

So removing these seems be a good idea. Another reason to remove these is
that atomisp_acc_map() is the only user of the userptr functionality in
hmm_alloc(), so it gets in the way of further cleanups / simplification
of the hmm code.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-19-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:44 +01:00
Hans de Goede
5c91529456 media: atomisp: remove bogus comment above hmm_bo_allocated() prototype
The comment documenting hmm_bo_allocated() was copied (and not modified)
from the comment documenting hmm_bo_alloc(), so there are 2 copies
of the hmm_bo_alloc() documentation.

Remove the copy of the comment above the hmm_bo_allocated() prototype.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-18-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:42 +01:00
Hans de Goede
b03d581b45 media: atomisp: removed unused hmm_bo_get_page_info() function
hmm_bo_get_page_info() is not used anywhere, remove it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-17-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:41 +01:00
Hans de Goede
2c9974955f media: atomisp: drop hmm_page_type
Since the hmm-pool code has been removed this now always gets set
to HMM_PAGE_TYPE_GENERAL, so just remove it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-16-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:40 +01:00
Hans de Goede
4be4504e9d media: atomisp: remove unused attribute argument from ia_css_frame_map()
ia_css_frame_map() has only one caller which passes a hardcoded 0
for the attribute argument, drop it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-15-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:39 +01:00
Hans de Goede
c0039ef3dc media: atomisp: remove pool related kernel cmdline options
Since we have removed the hmm pools these are completely meaningless now.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-14-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:38 +01:00
Hans de Goede
454da4d2a4 media: atomisp: remove hmm_mem_stats
Without pool support the (optional) debug logging done by these is
not really meaningful, drop it all.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-13-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:37 +01:00
Hans de Goede
c35f36b7c1 media: atomisp: remove hmm pool code
Since we never register any pools, this is all dead code,
remove it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-12-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:35 +01:00
Hans de Goede
b50b217fe2 media: atomisp: remove dynamic and reserved pool code
There are no callers of this code atm; and looking at the atomisp
memory-management code if anything we want to make it simpler and
not re-introduce use of these pools, so remove the pool code.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-11-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:33 +01:00
Hans de Goede
ad4c63c3ba media: atomisp: remove hmm_pool_[un]register()
These are no-ops, so lets remove them.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-10-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:31 +01:00
Hans de Goede
ca1ce57ae7 media: atomisp: drop ATOMISP_MAP_FLAG_CONTIGUOUS
Drop the ATOMISP_MAP_FLAG_CONTIGUOUS hmm_alloc flag. After the contiguous
flag removal done in previous patches in this series it is never set.

And hmm_alloc already did a WARN_ON on the flag and otherwise ignored it,
proving that contiguous support was already never used.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-9-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:30 +01:00
Hans de Goede
f94059f86e media: atomisp: drop contiguous flag from struct ia_css_frame
Drop the contiguous flag from struct ia_css_frame, it is always false /
not used.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-8-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:22:29 +01:00
Hans de Goede
1282033fe0 media: atomisp: drop IA_CSS_FRAME_FORMAT_MIPI support from ia_css_frame_init_planes()
Nothing ever sets the format to IA_CSS_FRAME_FORMAT_MIPI and
frame_init_mipi_plane() is the only code-path which ever sets
frame->contiguous to true.

Drop A_CSS_FRAME_FORMAT_MIPI support from ia_css_frame_init_planes()
as part of the removal of contiguous alloc support from the frame code.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-7-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:19:52 +01:00
Hans de Goede
dc65da4fb1 media: atomisp: drop contiguous argument from frame_create()
Drop the contiguous argument from frame_create()
all callers always passes false.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-6-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:18:17 +01:00
Hans de Goede
1c0d8f813f media: atomisp: drop contiguous argument from frame_allocate_with_data()
Drop the contiguous argument from frame_allocate_with_data()
its only caller always passes false.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-5-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:12:20 +01:00
Hans de Goede
001b48b60b media: atomisp: drop contiguous argument from ia_css_frame_allocate_with_buffer_size()
Drop the contiguous argument from ia_css_frame_allocate_with_buffer_size()
its only caller always passes false.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-4-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:11:06 +01:00
Hans de Goede
7c6b6a5bbd media: atomisp: remove unused ia_css_frame_allocate_contiguous*() functions
ia_css_frame_allocate_contiguous() and
ia_css_frame_allocate_contiguous_from_info() are not used anywhere,
remove them.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-3-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:10:46 +01:00
Hans de Goede
f2ce294155 media: atomisp: remove the unused RAW_BUF_STRIDE macro
I noticed that the RAW_BUF_STRIDE macro is using the removed
SH_CSS_BINARY_ID_POST_ISP define, which should be a problem except that
the RAW_BUF_STRIDE macro itself is not used at all, remove it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-2-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 16:10:27 +01:00
Nicolas Frattaroli
6f1ae821a6 media: hantro: Add support for RK356x encoder
The RK3566 and RK3568 SoCs come with a small Hantro instance which is
solely dedicated to encoding. This patch adds the necessary structs to
the Hantro driver to allow the JPEG encoder of it to function.

Through some sleuthing through the vendor's MPP source code and after
closer inspection of the TRM, it was determined that the hardware likely
supports VP8 and H.264 as well.

Tested with the following GStreamer command:

gst-launch-1.0 videotestsrc ! v4l2jpegenc ! matroskamux ! \
               filesink location=foo.mkv

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08 14:54:46 +01:00
Philipp Hortmann
2a1f94e455 staging: vt6655: Use loop in vt6655_mac_read_ether_addr
Use loop in vt6655_mac_read_ether_addr to avoid multiple
similar statements.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/f233c8a007d75a8adcc99a07c582b75bdc1985db.1657134099.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:29:22 +02:00
Philipp Hortmann
385b35ab80 staging: vt6655: Use loop in vt6655_mac_write_bssid_addr
Use loop in vt6655_mac_write_bssid_addr to avoid multiple
similar statements.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/b3b93ae7ce41562565e9007eb4580b9c47a2881f.1657134099.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:29:22 +02:00
Martin Kaiser
3deb12ea54 staging: r8188eu: pattrib addresses were already set by the caller
Do not set pattrib's src, dst, bssid, ra and ta again in
sta2sta_data_frame.

sta2sta_data_frame is called from validate_recv_data_frame when both to_ds
and from_ds are 0. All pattrib address fields have already been set to the
correct addresses when sta2sta_data_frame is called.

        memcpy(pattrib->dst, ieee80211_get_DA(hdr), ETH_ALEN);
            ieee80211_get_DA returns addr1 if to_ds and from_ds are 0

        memcpy(pattrib->src, ieee80211_get_SA(hdr), ETH_ALEN);
            ieee80211_get_SA returns addr2 if to_ds and from_ds are 0

        memcpy(pattrib->ra, hdr->addr1, ETH_ALEN);
        memcpy(pattrib->ta, hdr->addr2, ETH_ALEN);
            For pattrib->dst == addr1, pattrib->src == addr2, these
            assignments match those in sta2sta_data_frame that this
            patch removes.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220707194914.63794-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:29:07 +02:00
Martin Kaiser
8eaa8197bc staging: r8188eu: remove sta2sta_data_frame prototype
Remove the prototype for sta2sta_data_frame. Make the function static, it
is used only inside rtw_recv.c.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220707194914.63794-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:29:07 +02:00
Philipp Hortmann
7b5ec68ac1 staging: vt6655: Convert macro vt6655_mac_read_ether_addr to function
Convert macro vt6655_mac_read_ether_addr to static function.
checkpatch.pl does not accept multiline macros.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/2e2524187d9d3a6140fe4a5a35926db14dddfe98.1656835310.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:28:47 +02:00
Philipp Hortmann
5df564ca11 staging: vt6655: Convert macro vt6655_mac_write_bssid_addr to function
Convert macro vt6655_mac_write_bssid_addr to static function.
checkpatch.pl does not accept multiline macros.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/caecf7287d92c5d25ba0dfc16a24a6ce4aa67d55.1656835310.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:28:47 +02:00
Philipp Hortmann
52fbed10b8 staging: vt6655: Move two macros to file where those are used
Move two multiline macros to file of only useage to
convert them later to static functions.
checkpatch.pl does not accept multiline macros.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/b4a04608b3900186d4941b3bfe9463bb79e261e8.1656835310.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:28:47 +02:00
Philipp Hortmann
41c8e56bae staging: vt6655: Rename MACvReadEtherAddress
Fix name of a macro that uses CamelCase which is not
accepted by checkpatch.pl

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/3714f7cd3425e0ef0a3df0cc291131cdb85a3796.1656835310.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:28:47 +02:00
Philipp Hortmann
06f737ef8f staging: vt6655: Rename MACvWriteBSSIDAddress
Fix name of a macro that uses CamelCase which is not
accepted by checkpatch.pl

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/1190d93181409679f9ae348a95ea269b48b1115c.1656835310.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:28:46 +02:00
Philipp Hortmann
20cbfe17a4 staging: vt6655: Rename pbyEtherAddr to mac_addr
Fix name of a variable in two macros that use CamelCase which is not
accepted by checkpatch.pl

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/fcc66446a04c1ecb3c2b66cdd47e932c231b1b9d.1656835310.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:28:46 +02:00
Jakub Kicinski
60c85e23be staging: switch to netif_napi_add_weight()
netif_napi_add() will soon default to weight of 64 instead of
requiring the user to specify that parameter. Most users already
pass or should pass 64. Move the callers in staging to
netif_napi_add_weight() which will keep the argument.
This way we'll avoid a huge cross-tree conversion when
argument is removed.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20220705225801.923601-1-kuba@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:28:21 +02:00
Martin Kaiser
234cf3971b staging: r8188eu: use ieee80211 helper to check for nullfunc frame
Use the ieee80211_is_nullfunc function from ieee80211.h to check for a
nullfunc frame. This is a data frame whose subtype has bit6 set.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704201654.195574-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:47 +02:00
Martin Kaiser
c82bf6a83e staging: r8188eu: remove a misleading comment
Remove a misleading comment in ap2sta_data_frame. We are not checking
for QOS frames.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704201654.195574-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:46 +02:00
Martin Kaiser
6afc29cb46 staging: r8188eu: don't set pattrib->ta again
The table in ieee80211.h shows that TA is addr2. This value was already
set by validate_recv_data_frame, we don't have to set it again in
ap2sta_data_frame.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704201654.195574-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:46 +02:00
Martin Kaiser
ff2833e3f8 staging: r8188eu: don't set pattrib->ra again
Do not set pattrib->ra again in ap2sta_data_frame. This function is
called by validate_recv_data_frame when the packet's ToDS==0 and
FromDS==1.

validate_recv_data_frame has already set pattrib->ra to addr1. This is in
line with the table in ieee80211.h.

ap2sta_data_frame sets pattrib->ra to pattrib->dst. For ToDS==0, FromDS==1,
dst is addr1, i.e. ap2sta_data_frame sets the same value again that was
already set by validate_recv_data_frame.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704201654.195574-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:46 +02:00
Martin Kaiser
d6d0a11dd5 staging: r8188eu: don't set pattrib->dst again
Do not set pattrib->dst again in ap2sta_data_frame. This function is
called by validate_recv_data_frame when the packet's ToDS==0 and
FromDS==1.

In this case, validate_recv_data_frame has already set pattrib->dst
to addr1.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704201654.195574-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:46 +02:00
Martin Kaiser
c45f5c02a0 staging: r8188eu: set bssid only once
In function ap2sta_data_frame, for WIFI_MP_STATE && _FW_LINKED, the code
sets pattrib->bssid twice. Remove the first one of these assignments.
Remove an empty comment before the second assignment.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704201654.195574-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:46 +02:00
Rommel Rodriguez Perez
a3e20d9046 staging: r8188eu: Block comments use * on subsequent lines
This patch modifies a comment in order for it to comply with Linux
Kernel style guidelines on comments belonging to  net/ or drivers/net/ by
fixing the missing * at the beginning of each comment line and removing
the initial almost-blank initial line from the comment block.

checkpatch output:
WARNING: Block comments use * on subsequent lines

Reviewed-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Rommel Rodriguez Perez <alrodperez@gmail.com>
Link: https://lore.kernel.org/r/YsN993FTljv5LYT3@debianmain.debian.pc.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:16 +02:00
Martin Kaiser
1681e6f4d7 staging: r8188eu: mac addr len is unused
The MAC_ADDR_LEN define is not used. Remove it.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704145221.159949-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:05 +02:00
Martin Kaiser
4023f5f844 staging: r8188eu: remove sdio definitions
The r8188eu chipset is connected via usb. We don't need the register
and bit field definitions for the sdio interface.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704145221.159949-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:05 +02:00
Martin Kaiser
38fbc32e83 staging: r8188eu: read pwr seq length, remove PWR_CMD_END
The definitions of the power sequences are in the same file as the function
which processes them. We can simply read the number of entries in a power
sequence. There's no need for a PWR_CMD_END command to indicate the end
of a sequence.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704145221.159949-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:05 +02:00
Martin Kaiser
8be317cf61 staging: r8188eu: support only us in PWR_CMD_DELAY
PWR_CMD_DELAY has only a single remaining user, who needs a delay in us.
Remove the code and defines for delays in ms.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704145221.159949-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:05 +02:00
Martin Kaiser
687a7264fc staging: r8188eu: move pwr seq defines to HalPwrSeqCmd.c
The power sequences are now defined and processed in the same file. We
can move the defines for power sequences and the related struct and
enum from HalPwrSeqCmd.h to HalPwrSeqCmd.c. They don't have to be visible
in other files any more.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220704145221.159949-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:27:05 +02:00
Michael Straube
e0e91965a1 staging: r8188eu: make ffaddr2pipehdl() static
The function ffaddr2pipehdl() is only used in usb_ops_linux.c.
Make it static.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220702064626.27506-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:26:29 +02:00
Michael Straube
0571075097 staging: r8188eu: remove HW_VAR_AMPDU_FACTOR from SetHwReg8188EU()
Remove the case HW_VAR_AMPDU_FACTOR from SetHwReg8188EU() and move
the functionality to a static function in rtw_wlan_util.c. This is
part of the ongoing effort to get rid of SetHwReg8188EU().

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220701210753.8210-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:26:27 +02:00
Felix Schlepper
a27e2eb5e9 Staging: rtl8192e: Added spaces around '+'
This addresses two issues raised by checkpatch.pl:

     $ ./scripts/checkpatch.pl --terse -f drivers/staging/rtl8192e/rtllib_wx.c
     CHECK: spaces preferred around that '+' (ctx:VxV)

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
Link: https://lore.kernel.org/r/87628a2dd08ec0e5b02090485e7a9a1d91b7d2a5.1656667089.git.f3sch.git@outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:25:46 +02:00
Felix Schlepper
ea32f580e8 Staging: rtl8192e: Remove unnecessary blank line
This addresses an issue raised by checkpatch.pl:

     $ ./scripts/checkpatch.pl --terse -f drivers/staging/rtl8192e/rtllib_wx.c
     CHECK: Blank lines aren't necessary before a close brace '}'

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
Link: https://lore.kernel.org/r/f3c6bd5c79331e82f006fb2694f791030b07c5ba.1656667089.git.f3sch.git@outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:25:46 +02:00
Felix Schlepper
58f364ecb1 Staging: rtl8192e: Added braces around else
This addresses two issues raised by checkpatch.pl:

     $ ./scripts/checkpatch.pl --terse -f drivers/staging/rtl8192e/rtllib_wx.c
     CHECK: braces {} should be used on all arms of this statement
     CHECK: Unbalanced braces around else statement

The coding style rule with not using unnecessary braces around if/else
does not apply if only one branch is a single statement.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
Link: https://lore.kernel.org/r/651f51d9f92e8a445ceaf9f2073f16dd10458a74.1656667089.git.f3sch.git@outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:25:46 +02:00
Felix Schlepper
907d2772f7 Staging: rtl8192e: Remove unnecessary parentheses
This addresses an issue raised by checkpatch.pl:

     $ ./scripts/checkpatch.pl --terse -f drivers/staging/rtl8192e/rtllib_wx.c
     Unnecessary parentheses around wrqu->encoding

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
Link: https://lore.kernel.org/r/0e4e340be3f4c7f35a5381b726b1db5fc6842f10.1656667089.git.f3sch.git@outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:25:46 +02:00
Felix Schlepper
2393ef09ca Staging: rtl8192e: Avoid multiple assignments
This addresses an issue raised by checkpatch.pl:

     $ ./scripts/checkpatch.pl --terse -f drivers/staging/rtl8192e/rtllib_wx.c
     CHECK: multiple assignments should be avoided

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
Link: https://lore.kernel.org/r/899a1010643a05668465069951518e5dcab9c77e.1656667089.git.f3sch.git@outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:25:45 +02:00
Felix Schlepper
177a561e0b Staging: rtl8192e: Refactored rtllib_modes
The initial reason for looking at this code was an
issue raised by checkpatch.pl:

     $ ./scripts/checkpatch.pl --terse -f drivers/staging/rtl8192e/rtllib_wx.c
     CHECK: Please use a blank line after function/struct/union/enum
     declarations

The additional blank line above the struct/before the headers is
just cleaner.

However, as it turns out since there is no str formatting required
One can replace the error prone str + size struct with a char array.
The rest of this patch fixes the usecases.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
Link: https://lore.kernel.org/r/4dbc4939e88a2c94f1819b4b0cc2c81dc332710b.1656667089.git.f3sch.git@outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-08 14:25:45 +02:00
Eric Dumazet
504148fedb net: add skb_[inner_]tcp_all_headers helpers
Most drivers use "skb_transport_offset(skb) + tcp_hdrlen(skb)"
to compute headers length for a TCP packet, but others
use more convoluted (but equivalent) ways.

Add skb_tcp_all_headers() and skb_inner_tcp_all_headers()
helpers to harmonize this a bit.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-07-02 16:22:25 +01:00
Davidlohr Bueso
ee6c6e7342 staging/wlan-ng: get the correct struct hfa384x in work callback
hfa384x_usbctlx_completion_task() is bogusly using the reaper BH when
in fact this is the completion_bh. This was reflected when trying
to acquire the hw->ctlxq.lock and getting a failed lockdep class
initialized to it.

Fixes: 9442e81d7e ("staging/wlan-ng, prism2usb: replace completion_bh tasklet with work")
Reported-by: syzbot+ce3408364c4a234dd90c@syzkaller.appspotmail.com
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://lore.kernel.org/r/20220629165225.3436822-1-dave@stgolabs.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-01 09:58:58 +02:00
Yang Li
3355a12760 staging: r8188eu: remove unneeded semicolon
Eliminate the following coccicheck warning:
./drivers/staging/r8188eu/hal/HalPwrSeqCmd.c:70:2-3: Unneeded semicolon

Fixes: df8d0a5504 ("staging: r8188eu: make power sequences static")
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220630090937.4983-1-yang.lee@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-01 09:57:12 +02:00
Michael Straube
d61da1d7a1 staging: r8188eu: remove HW_VAR_H2C_MEDIA_STATUS_RPT from SetHwReg8188EU()
The HW_VAR_H2C_MEDIA_STATUS_RPT case in SetHwReg8188EU() only calls
rtl8188e_set_FwMediaStatus_cmd(). In order to get rid of
SetHwReg8188EU() remove the case HW_VAR_H2C_MEDIA_STATUS_RPT and call
rtl8188e_set_FwMediaStatus_cmd() directly.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220630061736.9200-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-01 09:56:58 +02:00
Martin Kaiser
c87d8e90bc staging: r8188eu: drop return value from receive_disconnect
The receive_disconnect function always returns _SUCCESS. None of the
callers checks the return value. We can remove it.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220626180734.287137-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-01 09:56:33 +02:00
Martin Kaiser
df8d0a5504 staging: r8188eu: make power sequences static
Simplify the handling of "power sequences". At the moment, this is rather
complicated:
The hal layer calls HalPwrSeqCmdParsing. This function takes a pointer to
a power sequence. The sequences themselves are defined as global variables
in a separate file. There's an alias for each sequence, the callers of
HalPwrSeqCmdParsing use these aliases instead of the sequences themselves.

There's no point in passing the sequences around. We can move the
sequences into the same file as the HalPwrSeqCmdParsing function where
they are used. Callers of HalPwrSeqCmdParsing can refer to a sequence by
using a numeric define rather than a pointer to the sequence.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220627085354.28849-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-27 13:51:08 +02:00
Martin Kaiser
1b0a54b3e8 staging: r8188eu: merge two led structs
The led layer uses struct led_priv and struct LED_871x to store state
info. Merge the two structs. Move LED_871x's components into led_priv.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220626181000.287225-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-27 13:50:49 +02:00
Martin Kaiser
80394da44b staging: r8188eu: remove rtw_usleep_os
Remove the rtw_usleep_os helper function. There are only two callers, both
of which call rtw_usleep_os(100). This is equivalent to msleep(1).

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Tested-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220626180603.287054-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-27 13:50:38 +02:00
Chang Yu
b78137d00a staging: r8188eu: core/rtw_recv.c: clean up nested if statements
Combine two nested if statements into a single one to fix indentation
issue and improve readability, as suggested by checkpatch.pl

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
Link: https://lore.kernel.org/r/20220624144526.437322-1-marcus.yu.56@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-27 13:50:30 +02:00
Phil Elwell
f6c99d8624 staging: vchiq_arm: Add missing memory barrier comments
One of points on the TODO list was to comment the memory barriers.
This patch addresses the missing ones in order to help reviewers.

Link: https://github.com/raspberrypi/linux/pull/5066
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/20220624163902.6913-1-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-27 13:50:19 +02:00
Felix Schlepper
acde2522fa Staging: rtl8192e: Cleaning up error handling
Moved error handling to one common block.
This removes double checking if all txb->fragments[]
were initialized.
The original code worked fine, but this is cleaner.

Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
Link: https://lore.kernel.org/r/13b32131cd00a1f0b8793657a24ada71240a8350.1656078068.git.f3sch.git@outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-27 13:50:03 +02:00
Felix Schlepper
9fdc63fe40 Staging: rtl8192e: Using kzalloc and delete memset
By using kzalloc, we can delete a memset.  The practical difference
is that using kzalloc() will zero out the txb->fragments[] array.
The original code worked fine, but zeroing everything seems nicer.

Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
Link: https://lore.kernel.org/r/9727fe31c675f2f3052ca2fa586d137dd856ac91.1656078068.git.f3sch.git@outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-27 13:50:03 +02:00
Felix Schlepper
71eac0c07c Staging: rtl8192e: Use struct_size
Using struct_size is encouraged because it is safer
than using sizeof and calculations by hand.

Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
Link: https://lore.kernel.org/r/54ea62a2b7628d3bdd5aa52df82c3e91704a2127.1656078068.git.f3sch.git@outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-27 13:50:03 +02:00
Jiang Jian
c2cc2aa1d0 media: av7110: Remove duplicate 'with' in two places.
file: ./drivers/staging/media/av7110/av7110.c
line: 2367
         * reset with with MASK_31 to MC1
changed to
         * reset with MASK_31 to MC1

Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27 09:31:18 +01:00
Zhang Zekun
3e52be9bc5 media: rkvdec:Remove redundant memset
As dma_alloc_coherent() will return a zeroed buffer, we
don't need to memset the returned buffer.
priv_tbl = dma_alloc_coherent() and count_tbl = dma_alloc_coherent()
should be enough.

-see commit 750afb08ca ("cross-tree: phase out dma_zalloc_coherent()")

Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27 09:13:03 +01:00
Chang Yu
a725a29d52 staging: r8188eu: Make rtw_signal_stat_timer_hdl a static function
Make rtw_signal_stat_timer_hdl a static function instead of a global
function.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
Link: https://lore.kernel.org/r/20220623043855.407208-1-marcus.yu.56@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-24 13:32:22 +02:00
Chang Yu
8821931e61 staging: r8188eu: Fixed some blank line coding style issues
Added blank lines after variable declarations as per checkpatch.pl

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
Link: https://lore.kernel.org/r/cf4d4f7a58c9ba4510bed6748f78491c91e3e6f3.1655872968.git.marcus.yu.56@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-22 11:33:13 +02:00
Chang Yu
c99c8bc938 staging: r8188eu: Fixed comment style
Fixed block comments style as per checkpatch.pl and kernel coding style
guide.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
Link: https://lore.kernel.org/r/fe45dd24a6ffcb4902a5efacaae63028f7c7a68f.1655872968.git.marcus.yu.56@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-22 11:33:13 +02:00
Chang Yu
3ff13c76b0 staging: r8188eu: Fixed two whitespace coding style issues
Replaced spaces with tabs as per checkpatch.pl

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
Link: https://lore.kernel.org/r/68cb57799d9139740f94eed9080e2d08c522e74c.1655872968.git.marcus.yu.56@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-22 11:33:13 +02:00
Chang Yu
dd875fb747 staging: r8188eu: Fixed two brace coding style issues
Removed two pairs of unnecessary curly braces as per checkpatch.pl

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
Link: https://lore.kernel.org/r/f08a494f324cf5a3b5ed73aab6b3a432cb1da67b.1655872968.git.marcus.yu.56@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-22 11:33:13 +02:00
Chang Yu
04b3b6ae8b staging: r8188eu: Fixed a function declaration coding style issue
Added an identifier name for function definition argument
'struct timer_list *' as per checkpatch.pl

Note that for the same line checkpatch.pl will also complain "extern
should be avoided in .c". I am not very familiar with the codebase
so I decided not to move the declaration to a header file.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
Link: https://lore.kernel.org/r/778c21724752f2de136d82b31c9ffc2bf35ced55.1655872968.git.marcus.yu.56@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-22 11:33:13 +02:00
Greg Kroah-Hartman
6ad9232a99 Merge branch 'staging-octeon' of gitolite.kernel.org:/pub/scm/linux/kernel/git/gregkh/staging into staging-next
This merges the movement of the octeon-usb driver out of
drivers/staging/ into drivers/usb.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

* 'staging-octeon' of gitolite.kernel.org:/pub/scm/linux/kernel/git/gregkh/staging:
  staging: octeon-usb: move driver out of staging
2022-06-22 11:29:07 +02:00
Artur Bujdoso
9dbdac024d staging: octeon-usb: move driver out of staging
The Octeon usb driver has been in staging for a long time and used in
Ubiquiti routers for a while now.
It's been built and then tested on real hardware with several usb devices
and it is proven to be stable and ready to be moved to its proper place
in the kernel tree.

Move it to drivers/usb/host and adjust its Makefile, Kconfig and defconfig
dependencies.

Many thanks to the developers who made it happen.

Signed-off-by: Artur Bujdoso <artur.bujdoso@gmail.com>
Link: https://lore.kernel.org/r/Yo0HBIlSXOBM+//9@crux
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-21 16:43:37 +02:00
Nam Cao
263929afa4 staging: r8188eu: remove basic_types.h
Remove file basic_types.h because the content of this file is not used
anywhere.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/1b8200420a2a1b7276f49eb3c2768ef39d641713.1655745123.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-21 09:05:22 +02:00
Nam Cao
908b130df5 staging: r8188eu: replace N_BYTE_ALIGMENT with ALIGN
Replace the macro N_BYTE_ALIGMENT (defined in this driver) with ALIGN
because they do the same thing.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/28087b76483f10dca1e1c3bdcba5e4b08eecd544.1655745123.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-21 09:05:21 +02:00
Veerendranath Jakkam
efbabc1165 cfg80211: Indicate MLO connection info in connect and roam callbacks
The MLO links used for connection with an MLD AP are decided by the
driver in case of SME offloaded to driver.

Add support for the drivers to indicate the information of links used
for MLO connection in connect and roam callbacks, update the connected
links information in wdev from connect/roam result sent by driver.
Also, send the connected links information to userspace.

Add a netlink flag attribute to indicate that userspace supports
handling of MLO connection. Drivers must not do MLO connection when this
flag is not set. This is to maintain backwards compatibility with older
supplicant versions which doesn't have support for MLO connection.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-06-20 12:57:09 +02:00